spec = describe "Router" $ do
let sampleRoutes = [( Tuple "/" "views/index.yaml" ),
( Tuple "/foo" "views/foo.yaml" ),
( Tuple "/bar" "views/bar.yaml" )]
it "should default to the first of the list" $ do
r <- fst <$> head sampleRoutes
fprint r
上記は次のエラーをスローします。
Error in declaration spec
Cannot unify Data.Maybe.Maybe with Control.Monad.Eff.Eff u4505.
type の2番目の引数が期待されているためだと思いますが、2番目の引数によって導入されたEff
の使用により、代わりに typeになります。Maybe
head
Maybe
it :: forall e a. String -> Eff e a -> Eff (it :: It | e) Unit
問題は、これを解決する方法がわかりません。Maybe
代わりに効果的なコード ブロックを使用できないでしょうか?