Something went wrong. Try again.
A fork of the source marterial for Certainty by Construction, from https://github.com/isovector/certainty-by-construction
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031{-# OPTIONS_GHC -Wno-orphans #-}
module Languages.Tree where
import Data.Stringimport Typesimport Dot
instance IsString a => IsString (LRose a) where fromString = LPure . fromString
instance (b ~ [LRose a], IsString a) => IsString (b -> LRose a) where fromString a x = LRose (fromString a) x
instance Num a => Num (LRose a) where fromInteger = LPure . fromInteger
instance (b ~ [LRose a], Num a) => Num (b -> LRose a) where fromInteger a x = LRose (fromInteger a) x
asRose :: LRose String -> LRose StringasRose = id
asNRose :: LRose Int -> LRose IntasNRose = id
asTrie :: Trie Int -> Trie IntasTrie = id