1.C语言字符串 字符串(character string)是一个或多个字符的序列,例如:"Zing went the strings of my heart!" C语言没有专门用于储存字符串的变量类型,字符串都被储存在char类型的数组中.数组由连续的存储单元组成,字符串中的字符被储存在相邻的存储单元中,每个单元储存一个字符.如下图: 注意图4.1中数组末尾位置的字符\0.这是空字符(null character),C语言用它标记字符串的结束.空字符不是数字0,它是非打印字符,其AS…
Category class Category cat where id :: cat a a (.) :: cat b c -> cat a b -> cat a c instance Category (->) where id = GHC.Base.id (.) = (GHC.Base..) (<<<) :: Category cat => cat b c -> cat a b -> cat a c (<<<) = (.) (&…
安装 free 包 $ cabal install free Installed free-5.0.2 Free Monad data Free f a = Pure a | Free (f (Free f a)) instance Functor f => Functor (Free f) where fmap f = go where go (Pure a) = Pure (f a) go (Free fa) = Free (go <$> fa) instance Functor f…