小编The*_*ave的帖子

Haskell 显示错误?

所以在一个文件中我有

import Data.String
import MyShow

data Tree a b = Leaf a | Branch b (Tree a b) (Tree a b)

instance (Show a, Show b) => Show (Tree a b) where
   show (Branch n t1 t2) = "(" ++ myshow t1 ++ myshow n ++ myshow t2 ++ ")"
   show (Leaf l) = myshow l

newtype MyString = MyString String

instance Show MyString where
    show (MyString s) = s
Run Code Online (Sandbox Code Playgroud)

在另一个名为 MyShow.hs 的文件中我有

{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE UndecidableInstances …
Run Code Online (Sandbox Code Playgroud)

haskell types show

0
推荐指数
1
解决办法
107
查看次数

标签 统计

haskell ×1

show ×1

types ×1