]> gitweb.factorcode.org Git - factor.git/blob - extra/taxes/usa/mn/mn.factor
factor: trim using lists
[factor.git] / extra / taxes / usa / mn / mn.factor
1 ! Copyright (C) 2008 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel math money taxes.usa taxes.usa.w4 usa-cities ;
4 IN: taxes.usa.mn
5
6 ! Minnesota
7 : mn-single ( -- triples )
8     {
9         {     0  1950  DECIMAL: 0     }
10         {  1950 23750  DECIMAL: .0535 }
11         { 23750 73540  DECIMAL: .0705 }
12         { 73540 1/0.   DECIMAL: .0785 }
13     } ;
14
15 : mn-married ( -- triples )
16     {
17         {      0   7400 DECIMAL: 0     }
18         {   7400  39260 DECIMAL: .0535 }
19         {  39260 133980 DECIMAL: .0705 }
20         { 133980   1/0. DECIMAL: .0785 }
21     } ;
22
23 : <mn> ( -- obj )
24     MN mn-single mn-married <tax-table> ;
25
26 M: MN adjust-allowances* ( salary w4 collector entity -- newsalary )
27     2drop calculate-w4-allowances - ;
28
29 M: MN withholding* ( salary w4 collector entity -- x )
30     drop
31     [ adjust-allowances ] 2keep marriage-table tax ;