Commit c4268e09 authored by Hans-Peter Deifel's avatar Hans-Peter Deifel 🐢
Browse files

Move SomeEncoding type to MorphismEncoding module

It's needed in other modules than the parser
parent 8c6a353e
{-# LANGUAGE GADTs #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE RecordWildCards #-}
module Data.MorphismEncoding
( Encoding(edges)
, SomeEncoding(..)
, EdgeRef(..)
, Edge(..)
, new
......@@ -29,6 +32,12 @@ data Encoding a h1 = Encoding
}
deriving (Show)
data SomeEncoding where
SomeEncoding :: (Show a, Show h1) => Encoding a h1 -> SomeEncoding
deriving instance Show SomeEncoding
new :: Vector h1 -> Vector (Edge a) -> Encoding a h1
new structure edges = Encoding {..}
......
......@@ -55,11 +55,6 @@ parseFunctor value =
failUnknownFunctor name = fail ("Functor " ++ T.unpack name ++ " not found")
failIllegalJson = fail "Illegal functor specification"
data SomeEncoding where
SomeEncoding :: (Show a, Show h1) => Encoding a h1 -> SomeEncoding
deriving instance Show SomeEncoding
parseSomeEncoding :: SomeRefinementInterface -> Vector Yaml.Value -> Yaml.Parser SomeEncoding
parseSomeEncoding (SRI ri) value = SomeEncoding <$> parse ri value
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment