Closed YuMingLiao closed 5 years ago
Hi, @agentm
Just encounter this when I try to learn the use of atom function.
It fails at the first example, but succeeds on the second one.
TutorialD (master/main): addatomfunction "celsiusToFahrenheit" Int -> Either AtomFunctionError Int """(\\((IntAtom c):_) -> pure $ IntAtom ( (c * 9 `div` 5) + 32)) :: [Atom] -> Either AtomFunctionError Atom""" ERR: parse error on input `->' TutorialD (master/main): data CelsiusTemperature = CelsiusTemperature Int TutorialD (master/main): data FahrenheitTemperature = FahrenheitTemperature Int TutorialD (master/main): addatomfunction "celsiusToFahrenheit" CelsiusTemperature -> Either AtomFunctionError FahrenheitTemperature """(\(ConstructedAtom _ _ (IntAtom celsius:_):_) -> pure $ ConstructedAtom "Fahrenheit" (ConstructedAtomType "Fahrenheit" empty) [IntAtom (celsius * (9 `div` 5) + 32)]) :: [Atom] -> Either AtomFunctionError Atom """ TutorialD (master/main):
found it! Just one less \ and the example works. Closed.
\
Oops, thanks for finding that!
Hi, @agentm
Just encounter this when I try to learn the use of atom function.
It fails at the first example, but succeeds on the second one.