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 (<<<) = (.) (&…
Data.Text.Read Prelude> :set -XOverloadedStrings Prelude> :m +Data.Text.Read Prelude Data.Text.Read> decimal "123" Right (123,"") Prelude Data.Text.Read> decimal "abc" Left "input does not start with a digit&…
Data.Typeable 利用 Data.Typeable,可以打印动态类型信息. class Typeable (a :: k) where typeRep# :: TypeRep a typeRep :: Typeable a => TypeRep a typeRep = typeRep# typeOf :: Typeable a => a -> TypeRep a typeOf _ = typeRep typeOf 函数可以返回某个值的类型信息. {-# LANGUAGE Der…