2011-10-04から1日間の記事一覧
まずは誤りコード(正コードは下に) module ClassTest where data MyList a = List a (MyList a) | Nil deriving Show instance Monad MyList where return x = List x Nil Nil >>= f = Nil List x xs >>= f = f x fail s = Nil --おまけ myConcat :: Show …
まずは誤りコード(正コードは下に) module ClassTest where data MyList a = List a (MyList a) | Nil deriving Show instance Monad MyList where return x = List x Nil Nil >>= f = Nil List x xs >>= f = f x fail s = Nil --おまけ myConcat :: Show …