Skip to content

Instantly share code, notes, and snippets.

@amalloy
Created December 18, 2018 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amalloy/125a938d1cf6c099dcbbe25da9d6159e to your computer and use it in GitHub Desktop.
Save amalloy/125a938d1cf6c099dcbbe25da9d6159e to your computer and use it in GitHub Desktop.
Main.hs:14:15: error:
• Expected kind ‘k0 -> k1’, but ‘Fix NodeF’ has kind ‘*’
• In the type ‘Fix NodeF a’
In the type declaration for ‘Node’
|
14 | type Node a = Fix NodeF a
| ^^^^^^^^^^^
Main.hs:14:19: error:
• Expecting one more argument to ‘NodeF’
Expected kind ‘* -> *’, but ‘NodeF’ has kind ‘(* -> *) -> * -> *’
• In the first argument of ‘Fix’, namely ‘NodeF’
In the type ‘Fix NodeF a’
In the type declaration for ‘Node’
|
14 | type Node a = Fix NodeF a
| ^^^^^
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveFunctor #-}
module Main where
import Control.Arrow ((&&&))
import Control.Monad (replicateM)
import Data.Functor.Foldable (Fix, cata)
import qualified Data.IntMap.Lazy as M
import Text.Parsec.Char (spaces, digit, char)
import Text.Parsec.String (Parser)
import Text.Parsec (parse, many1, sepEndBy1)
data NodeF f a = NodeF (f a) [a] deriving (Show, Functor, Foldable)
type Node a = Fix NodeF a
-- ... more stuff ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment