Copyright | (c) Jun Narumi 2018 |
---|---|
License | BSD3 |
Maintainer | narumij@gmail.com |
Stability | experimental |
Portability | ? |
Safe Haskell | Safe |
Language | Haskell2010 |
Handle fractions described in /, not%
Documentation
Type of read and show slash form rational
>>>
getRatio . read $ "1/2"
1 % 2
>>>
map getRatio . read $ "[1/2,3/4,5/6]"
[1 % 2,3 % 4,5 % 6]
>>>
Slash (1 % 2)
1/2
>>>
map Slash [1%2,3%4,5%6]
[1/2,3/4,5/6]