diff options
| author | Charles <sircharlesaze@gmail.com> | 2020-03-16 10:50:03 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2020-03-16 10:50:03 +0100 |
| commit | d8751f2cced8f14366533ff0dbbc62fa73ec8665 (patch) | |
| tree | e216acbfb3d91cfe25870af93626240dbc7afcb3 /src/atom.hs | |
| parent | cc2593028c5f380e177adbf8905a43d665ac64cf (diff) | |
| download | computorv2-d8751f2cced8f14366533ff0dbbc62fa73ec8665.tar.gz computorv2-d8751f2cced8f14366533ff0dbbc62fa73ec8665.tar.bz2 computorv2-d8751f2cced8f14366533ff0dbbc62fa73ec8665.zip | |
Clean parser for expression containing rational and imaginary
Diffstat (limited to 'src/atom.hs')
| -rw-r--r-- | src/atom.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/atom.hs b/src/atom.hs index d01b157..5f1b42c 100644 --- a/src/atom.hs +++ b/src/atom.hs @@ -30,6 +30,10 @@ _ /? (ARational 0) = Nothing (ARational a) /? (ARational b) = Just $ ARational (a / b) _ /? _ = Nothing +infixl 7 %? +(%?) :: Atom -> Atom -> Maybe Atom +_ %? _ = Nothing + infixr 8 ^? (^?) :: Atom -> Atom -> Maybe Atom (ARational a) ^? (ARational b) = Just $ ARational (a ** b) |
