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 | |
DataKinds, | |
DeriveGeneric, | |
PolyKinds, | |
StandaloneDeriving, | |
TypeFamilies, | |
UndecidableInstances #-} | |
module T where | |
import Data.Kind (Constraint, Type) |
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
// Inspired by: http://www.cs.nott.ac.uk/~pszgmh/monparsing.pdf | |
// A Parser is a function that given a string and an index into that string | |
// produces a parsed value and the index of the first unparsed character in the string | |
type Parser<'T> = P of (string -> int -> ('T*int) option) | |
module Parser = | |
open System | |
// Runs the parser on a string |
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 TemplateHaskell #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
module Bad where | |
import Prelude | |
import Data.Kind ( Type ) | |
import Generics.MultiRec.TH |