Created
December 18, 2018 19:47
-
-
Save amalloy/125a938d1cf6c099dcbbe25da9d6159e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
| ^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# 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