Skip to content

Commit

Permalink
Same for integers
Browse files Browse the repository at this point in the history
  • Loading branch information
Shimuuar committed Mar 9, 2011
1 parent ff8182a commit 6bccc04
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions TypeLevel/Number/Int.hs
Expand Up @@ -48,12 +48,12 @@ splitToTrits x | n == 0 = 0 : splitToTrits rest

-- | Generate type for integer number.
intT :: Integer -> TypeQ
intT = foldr appT [t| ZZ |] . map con . splitToTrits
intT = foldr appT (conT ''ZZ) . map con . splitToTrits
where
con (-1) = [t| Dn |]
con 0 = [t| D0 |]
con 1 = [t| D1 |]
con x = error $ "Strange trit: " ++ show x
con (-1) = conT ''Dn
con 0 = conT ''D0
con 1 = conT ''D1
con x = error $ "Strange trit: " ++ show x

----------------------------------------------------------------
--
Expand Down

0 comments on commit 6bccc04

Please sign in to comment.