Closed henrylaxen closed 9 years ago
Messed up the formatting, sorry.
module Main where
import Prelude
newtype I = I Int -- this fails with:
-- fay: user error
-- (Pattern match failure in do expression at src/Fay/Compiler/Decl.hs:101:7-20)
-- data I = I Int -- this compiles
test :: I -> Fay ()
test x = do
let
I i = x
return ()
Very hacky fix, but it works! Released as fay-0.23.1.1
Thanks for the report!
Hi again Adam,
While trying to compile this:
module Main where import Prelude
newtype I = I Int -- this fails with: -- fay: user error -- (Pattern match failure in do expression at src/Fay/Compiler/Decl.hs:101:7-20)
-- data I = I Int -- this compiles
test :: I -> Fay ()
test x = do let I i = x return ()module Main where import Prelude
newtype I = I Int -- this fails with: -- fay: user error -- (Pattern match failure in do expression at src/Fay/Compiler/Decl.hs:101:7-20)
-- data I = I Int -- this compiles
test :: I -> Fay ()
test x = do let I i = x return ()
I get a compiler error. A workaround is using data instead of newtype. Thought you should know.
Best wishes, Henry Laxen