packages feed

hydra-kernel 0.17.5 → 0.17.6

raw patch · 275 files changed

+3329/−1771 lines, 275 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Hydra.Dsl.Lib.Eithers: pure :: TypedTerm y -> TypedTerm (Either x y)
- Hydra.Dsl.Lib.Lists: null :: TypedTerm [x] -> TypedTerm Bool
- Hydra.Dsl.Lib.Lists: pure :: TypedTerm x -> TypedTerm [x]
- Hydra.Dsl.Lib.Literals: readBigint :: TypedTerm String -> TypedTerm (Maybe Integer)
- Hydra.Dsl.Lib.Literals: readDecimal :: TypedTerm String -> TypedTerm (Maybe Scientific)
- Hydra.Dsl.Lib.Literals: readFloat32 :: TypedTerm String -> TypedTerm (Maybe Float)
- Hydra.Dsl.Lib.Literals: readFloat64 :: TypedTerm String -> TypedTerm (Maybe Double)
- Hydra.Dsl.Lib.Literals: readInt16 :: TypedTerm String -> TypedTerm (Maybe Int16)
- Hydra.Dsl.Lib.Literals: readInt32 :: TypedTerm String -> TypedTerm (Maybe Int)
- Hydra.Dsl.Lib.Literals: readInt64 :: TypedTerm String -> TypedTerm (Maybe Int64)
- Hydra.Dsl.Lib.Literals: readInt8 :: TypedTerm String -> TypedTerm (Maybe Int8)
- Hydra.Dsl.Lib.Literals: readUint16 :: TypedTerm String -> TypedTerm (Maybe Int)
- Hydra.Dsl.Lib.Literals: readUint32 :: TypedTerm String -> TypedTerm (Maybe Int64)
- Hydra.Dsl.Lib.Literals: readUint64 :: TypedTerm String -> TypedTerm (Maybe Integer)
- Hydra.Dsl.Lib.Literals: readUint8 :: TypedTerm String -> TypedTerm (Maybe Int16)
- Hydra.Dsl.Lib.Literals: showBigint :: TypedTerm Integer -> TypedTerm String
- Hydra.Dsl.Lib.Literals: showDecimal :: TypedTerm Scientific -> TypedTerm String
- Hydra.Dsl.Lib.Literals: showFloat32 :: TypedTerm Float -> TypedTerm String
- Hydra.Dsl.Lib.Literals: showFloat64 :: TypedTerm Double -> TypedTerm String
- Hydra.Dsl.Lib.Literals: showInt16 :: TypedTerm Int16 -> TypedTerm String
- Hydra.Dsl.Lib.Literals: showInt32 :: TypedTerm Int -> TypedTerm String
- Hydra.Dsl.Lib.Literals: showInt64 :: TypedTerm Int64 -> TypedTerm String
- Hydra.Dsl.Lib.Literals: showInt8 :: TypedTerm Int8 -> TypedTerm String
- Hydra.Dsl.Lib.Literals: showUint16 :: TypedTerm Int -> TypedTerm String
- Hydra.Dsl.Lib.Literals: showUint32 :: TypedTerm Int64 -> TypedTerm String
- Hydra.Dsl.Lib.Literals: showUint64 :: TypedTerm Integer -> TypedTerm String
- Hydra.Dsl.Lib.Literals: showUint8 :: TypedTerm Int16 -> TypedTerm String
- Hydra.Dsl.Lib.Maps: null :: Ord k => TypedTerm (Map k v) -> TypedTerm Bool
- Hydra.Dsl.Lib.Optionals: pure :: TypedTerm x -> TypedTerm (Maybe x)
- Hydra.Dsl.Lib.Sets: null :: Ord x => TypedTerm (Set x) -> TypedTerm Bool
- Hydra.Dsl.Lib.Strings: null :: TypedTerm String -> TypedTerm Bool
- Hydra.Dsl.Paths: subtermEdgeSource :: TypedTerm SubtermEdge -> TypedTerm SubtermNode
- Hydra.Dsl.Paths: subtermEdgeWithSource :: TypedTerm SubtermEdge -> TypedTerm SubtermNode -> TypedTerm SubtermEdge
- Hydra.Dsl.Paths: subtermGraphEdges :: TypedTerm SubtermGraph -> TypedTerm [SubtermEdge]
- Hydra.Dsl.Paths: subtermGraphWithEdges :: TypedTerm SubtermGraph -> TypedTerm [SubtermEdge] -> TypedTerm SubtermGraph
- Hydra.Dsl.Paths: subtermNodeId :: TypedTerm SubtermNode -> TypedTerm String
- Hydra.Dsl.Paths: subtermNodeLabel :: TypedTerm SubtermNode -> TypedTerm String
- Hydra.Dsl.Paths: subtermNodeWithId :: TypedTerm SubtermNode -> TypedTerm String -> TypedTerm SubtermNode
- Hydra.Dsl.Paths: subtermNodeWithLabel :: TypedTerm SubtermNode -> TypedTerm String -> TypedTerm SubtermNode
- Hydra.Dsl.Paths: subtermStepInjectionTerm :: TypedTerm SubtermStep
- Hydra.Dsl.Paths: subtermStepOptionalTerm :: TypedTerm SubtermStep
- Hydra.Dsl.Paths: subtermStepProductTerm :: TypedTerm Int -> TypedTerm SubtermStep
- Hydra.Dsl.Paths: subtermStepSumTerm :: TypedTerm SubtermStep
- Hydra.Dsl.Paths: subtermStepTypeApplicationTerm :: TypedTerm SubtermStep
- Hydra.Dsl.Paths: subtermStepUnionCasesBranch :: TypedTerm Name -> TypedTerm SubtermStep
- Hydra.Dsl.Paths: subtermStepUnionCasesDefault :: TypedTerm SubtermStep
- Hydra.Dsl.Paths: subtermStepWrappedTerm :: TypedTerm SubtermStep
- Hydra.Dsl.Paths: subtypeEdgeSource :: TypedTerm SubtypeEdge -> TypedTerm SubtypeNode
- Hydra.Dsl.Paths: subtypeEdgeWithSource :: TypedTerm SubtypeEdge -> TypedTerm SubtypeNode -> TypedTerm SubtypeEdge
- Hydra.Dsl.Paths: subtypeGraphEdges :: TypedTerm SubtypeGraph -> TypedTerm [SubtypeEdge]
- Hydra.Dsl.Paths: subtypeGraphWithEdges :: TypedTerm SubtypeGraph -> TypedTerm [SubtypeEdge] -> TypedTerm SubtypeGraph
- Hydra.Dsl.Paths: subtypeNodeId :: TypedTerm SubtypeNode -> TypedTerm String
- Hydra.Dsl.Paths: subtypeNodeLabel :: TypedTerm SubtypeNode -> TypedTerm String
- Hydra.Dsl.Paths: subtypeNodeWithId :: TypedTerm SubtypeNode -> TypedTerm String -> TypedTerm SubtypeNode
- Hydra.Dsl.Paths: subtypeNodeWithLabel :: TypedTerm SubtypeNode -> TypedTerm String -> TypedTerm SubtypeNode
- Hydra.Dsl.Paths: subtypeStepWrappedType :: TypedTerm SubtypeStep
- Hydra.Lib.Eithers: pure :: PrimitiveDefinition
- Hydra.Lib.Lists: null :: PrimitiveDefinition
- Hydra.Lib.Lists: pure :: PrimitiveDefinition
- Hydra.Lib.Literals: readBigint :: PrimitiveDefinition
- Hydra.Lib.Literals: readDecimal :: PrimitiveDefinition
- Hydra.Lib.Literals: readFloat32 :: PrimitiveDefinition
- Hydra.Lib.Literals: readFloat64 :: PrimitiveDefinition
- Hydra.Lib.Literals: readInt16 :: PrimitiveDefinition
- Hydra.Lib.Literals: readInt32 :: PrimitiveDefinition
- Hydra.Lib.Literals: readInt64 :: PrimitiveDefinition
- Hydra.Lib.Literals: readInt8 :: PrimitiveDefinition
- Hydra.Lib.Literals: readUint16 :: PrimitiveDefinition
- Hydra.Lib.Literals: readUint32 :: PrimitiveDefinition
- Hydra.Lib.Literals: readUint64 :: PrimitiveDefinition
- Hydra.Lib.Literals: readUint8 :: PrimitiveDefinition
- Hydra.Lib.Literals: showBigint :: PrimitiveDefinition
- Hydra.Lib.Literals: showDecimal :: PrimitiveDefinition
- Hydra.Lib.Literals: showFloat32 :: PrimitiveDefinition
- Hydra.Lib.Literals: showFloat64 :: PrimitiveDefinition
- Hydra.Lib.Literals: showInt16 :: PrimitiveDefinition
- Hydra.Lib.Literals: showInt32 :: PrimitiveDefinition
- Hydra.Lib.Literals: showInt64 :: PrimitiveDefinition
- Hydra.Lib.Literals: showInt8 :: PrimitiveDefinition
- Hydra.Lib.Literals: showUint16 :: PrimitiveDefinition
- Hydra.Lib.Literals: showUint32 :: PrimitiveDefinition
- Hydra.Lib.Literals: showUint64 :: PrimitiveDefinition
- Hydra.Lib.Literals: showUint8 :: PrimitiveDefinition
- Hydra.Lib.Maps: null :: PrimitiveDefinition
- Hydra.Lib.Optionals: pure :: PrimitiveDefinition
- Hydra.Lib.Sets: null :: PrimitiveDefinition
- Hydra.Lib.Strings: null :: PrimitiveDefinition
- Hydra.Overlay.Haskell.Lib.Eithers: pure :: b -> Either a b
- Hydra.Overlay.Haskell.Lib.Lists: null :: [a] -> Bool
- Hydra.Overlay.Haskell.Lib.Lists: pure :: a -> [a]
- Hydra.Overlay.Haskell.Lib.Literals: readBigint :: String -> Maybe Integer
- Hydra.Overlay.Haskell.Lib.Literals: readDecimal :: String -> Maybe Scientific
- Hydra.Overlay.Haskell.Lib.Literals: readFloat32 :: String -> Maybe Float
- Hydra.Overlay.Haskell.Lib.Literals: readFloat64 :: String -> Maybe Double
- Hydra.Overlay.Haskell.Lib.Literals: readInt16 :: String -> Maybe Int16
- Hydra.Overlay.Haskell.Lib.Literals: readInt32 :: String -> Maybe Int
- Hydra.Overlay.Haskell.Lib.Literals: readInt64 :: String -> Maybe Int64
- Hydra.Overlay.Haskell.Lib.Literals: readInt8 :: String -> Maybe Int8
- Hydra.Overlay.Haskell.Lib.Literals: readUint16 :: String -> Maybe Int
- Hydra.Overlay.Haskell.Lib.Literals: readUint32 :: String -> Maybe Int64
- Hydra.Overlay.Haskell.Lib.Literals: readUint64 :: String -> Maybe Integer
- Hydra.Overlay.Haskell.Lib.Literals: readUint8 :: String -> Maybe Int16
- Hydra.Overlay.Haskell.Lib.Literals: showBigint :: Integer -> String
- Hydra.Overlay.Haskell.Lib.Literals: showDecimal :: Scientific -> String
- Hydra.Overlay.Haskell.Lib.Literals: showFloat32 :: Float -> String
- Hydra.Overlay.Haskell.Lib.Literals: showFloat64 :: Double -> String
- Hydra.Overlay.Haskell.Lib.Literals: showInt16 :: Int16 -> String
- Hydra.Overlay.Haskell.Lib.Literals: showInt32 :: Int -> String
- Hydra.Overlay.Haskell.Lib.Literals: showInt64 :: Int64 -> String
- Hydra.Overlay.Haskell.Lib.Literals: showInt8 :: Int8 -> String
- Hydra.Overlay.Haskell.Lib.Literals: showUint16 :: Int -> String
- Hydra.Overlay.Haskell.Lib.Literals: showUint32 :: Int64 -> String
- Hydra.Overlay.Haskell.Lib.Literals: showUint64 :: Integer -> String
- Hydra.Overlay.Haskell.Lib.Literals: showUint8 :: Int16 -> String
- Hydra.Overlay.Haskell.Lib.Maps: null :: Map k v -> Bool
- Hydra.Overlay.Haskell.Lib.Optionals: pure :: a -> Maybe a
- Hydra.Overlay.Haskell.Lib.Sets: null :: Set x -> Bool
- Hydra.Overlay.Haskell.Lib.Strings: null :: String -> Bool
- Hydra.Paths: SubtermStepInjectionTerm :: SubtermStep
- Hydra.Paths: SubtermStepOptionalTerm :: SubtermStep
- Hydra.Paths: SubtermStepProductTerm :: Int -> SubtermStep
- Hydra.Paths: SubtermStepSumTerm :: SubtermStep
- Hydra.Paths: SubtermStepTypeApplicationTerm :: SubtermStep
- Hydra.Paths: SubtermStepUnionCasesBranch :: Name -> SubtermStep
- Hydra.Paths: SubtermStepUnionCasesDefault :: SubtermStep
- Hydra.Paths: SubtermStepWrappedTerm :: SubtermStep
- Hydra.Paths: SubtypeStepWrappedType :: SubtypeStep
- Hydra.Paths: [subtermEdgeSource] :: SubtermEdge -> SubtermNode
- Hydra.Paths: [subtermGraphEdges] :: SubtermGraph -> [SubtermEdge]
- Hydra.Paths: [subtermNodeId] :: SubtermNode -> String
- Hydra.Paths: [subtermNodeLabel] :: SubtermNode -> String
- Hydra.Paths: [subtypeEdgeSource] :: SubtypeEdge -> SubtypeNode
- Hydra.Paths: [subtypeGraphEdges] :: SubtypeGraph -> [SubtypeEdge]
- Hydra.Paths: [subtypeNodeId] :: SubtypeNode -> String
- Hydra.Paths: [subtypeNodeLabel] :: SubtypeNode -> String
- Hydra.Paths: _SubtermEdge_source :: Name
- Hydra.Paths: _SubtermGraph_edges :: Name
- Hydra.Paths: _SubtermNode_id :: Name
- Hydra.Paths: _SubtermNode_label :: Name
- Hydra.Paths: _SubtermStep_injectionTerm :: Name
- Hydra.Paths: _SubtermStep_optionalTerm :: Name
- Hydra.Paths: _SubtermStep_productTerm :: Name
- Hydra.Paths: _SubtermStep_sumTerm :: Name
- Hydra.Paths: _SubtermStep_typeApplicationTerm :: Name
- Hydra.Paths: _SubtermStep_unionCasesBranch :: Name
- Hydra.Paths: _SubtermStep_unionCasesDefault :: Name
- Hydra.Paths: _SubtermStep_wrappedTerm :: Name
- Hydra.Paths: _SubtypeEdge_source :: Name
- Hydra.Paths: _SubtypeGraph_edges :: Name
- Hydra.Paths: _SubtypeNode_id :: Name
- Hydra.Paths: _SubtypeNode_label :: Name
- Hydra.Paths: _SubtypeStep_wrappedType :: Name
- Hydra.Print.Emacs.Regex: showCodePoint :: Int -> String
- Hydra.Print.Paths: termToSubtermGraph :: Map ModuleName String -> Term -> SubtermGraph
- Hydra.Print.Pcre.Regex: showCodePoint :: Int -> String
- Hydra.Print.Posix.Regex: showCodePoint :: Int -> String
- Hydra.Print.Regex: showCodePoint :: Int -> String
+ Hydra.Decode.Paths: subtermAttribute :: Graph -> Term -> Either DecodingError SubtermAttribute
+ Hydra.Decode.Paths: subtermLink :: Graph -> Term -> Either DecodingError SubtermLink
+ Hydra.Decode.Paths: subtermProperty :: Graph -> Term -> Either DecodingError SubtermProperty
+ Hydra.Decode.Paths: subtypeAttribute :: Graph -> Term -> Either DecodingError SubtypeAttribute
+ Hydra.Decode.Paths: subtypeLink :: Graph -> Term -> Either DecodingError SubtypeLink
+ Hydra.Decode.Paths: subtypeProperty :: Graph -> Term -> Either DecodingError SubtypeProperty
+ Hydra.Decode.Paths: termAttribute :: Graph -> Term -> Either DecodingError TermAttribute
+ Hydra.Decode.Paths: typeAttribute :: Graph -> Term -> Either DecodingError TypeAttribute
+ Hydra.Dsl.Lib.Eithers: left :: TypedTerm x -> TypedTerm (Either x y)
+ Hydra.Dsl.Lib.Eithers: right :: TypedTerm y -> TypedTerm (Either x y)
+ Hydra.Dsl.Lib.Lists: isEmpty :: TypedTerm [x] -> TypedTerm Bool
+ Hydra.Dsl.Lib.Literals: parseBigint :: TypedTerm String -> TypedTerm (Maybe Integer)
+ Hydra.Dsl.Lib.Literals: parseDecimal :: TypedTerm String -> TypedTerm (Maybe Scientific)
+ Hydra.Dsl.Lib.Literals: parseFloat32 :: TypedTerm String -> TypedTerm (Maybe Float)
+ Hydra.Dsl.Lib.Literals: parseFloat64 :: TypedTerm String -> TypedTerm (Maybe Double)
+ Hydra.Dsl.Lib.Literals: parseInt16 :: TypedTerm String -> TypedTerm (Maybe Int16)
+ Hydra.Dsl.Lib.Literals: parseInt32 :: TypedTerm String -> TypedTerm (Maybe Int)
+ Hydra.Dsl.Lib.Literals: parseInt64 :: TypedTerm String -> TypedTerm (Maybe Int64)
+ Hydra.Dsl.Lib.Literals: parseInt8 :: TypedTerm String -> TypedTerm (Maybe Int8)
+ Hydra.Dsl.Lib.Literals: parseUint16 :: TypedTerm String -> TypedTerm (Maybe Int)
+ Hydra.Dsl.Lib.Literals: parseUint32 :: TypedTerm String -> TypedTerm (Maybe Int64)
+ Hydra.Dsl.Lib.Literals: parseUint64 :: TypedTerm String -> TypedTerm (Maybe Integer)
+ Hydra.Dsl.Lib.Literals: parseUint8 :: TypedTerm String -> TypedTerm (Maybe Int16)
+ Hydra.Dsl.Lib.Literals: printBigint :: TypedTerm Integer -> TypedTerm String
+ Hydra.Dsl.Lib.Literals: printDecimal :: TypedTerm Scientific -> TypedTerm String
+ Hydra.Dsl.Lib.Literals: printFloat32 :: TypedTerm Float -> TypedTerm String
+ Hydra.Dsl.Lib.Literals: printFloat64 :: TypedTerm Double -> TypedTerm String
+ Hydra.Dsl.Lib.Literals: printInt16 :: TypedTerm Int16 -> TypedTerm String
+ Hydra.Dsl.Lib.Literals: printInt32 :: TypedTerm Int -> TypedTerm String
+ Hydra.Dsl.Lib.Literals: printInt64 :: TypedTerm Int64 -> TypedTerm String
+ Hydra.Dsl.Lib.Literals: printInt8 :: TypedTerm Int8 -> TypedTerm String
+ Hydra.Dsl.Lib.Literals: printUint16 :: TypedTerm Int -> TypedTerm String
+ Hydra.Dsl.Lib.Literals: printUint32 :: TypedTerm Int64 -> TypedTerm String
+ Hydra.Dsl.Lib.Literals: printUint64 :: TypedTerm Integer -> TypedTerm String
+ Hydra.Dsl.Lib.Literals: printUint8 :: TypedTerm Int16 -> TypedTerm String
+ Hydra.Dsl.Lib.Maps: isEmpty :: TypedTerm (Map k v) -> TypedTerm Bool
+ Hydra.Dsl.Lib.Optionals: given :: TypedTerm x -> TypedTerm (Maybe x)
+ Hydra.Dsl.Lib.Pairs: pair :: TypedTerm a -> TypedTerm b -> TypedTerm (a, b)
+ Hydra.Dsl.Lib.Sets: isEmpty :: TypedTerm (Set x) -> TypedTerm Bool
+ Hydra.Dsl.Lib.Strings: isEmpty :: TypedTerm String -> TypedTerm Bool
+ Hydra.Dsl.Paths: subtermAttribute :: TypedTerm SubtermPath -> TypedTerm TermAttribute -> TypedTerm SubtermAttribute
+ Hydra.Dsl.Paths: subtermAttributePath :: TypedTerm SubtermAttribute -> TypedTerm SubtermPath
+ Hydra.Dsl.Paths: subtermAttributeSubtermAttribute :: TypedName SubtermAttribute
+ Hydra.Dsl.Paths: subtermAttributeTarget :: TypedTerm SubtermAttribute -> TypedTerm TermAttribute
+ Hydra.Dsl.Paths: subtermAttributeWithPath :: TypedTerm SubtermAttribute -> TypedTerm SubtermPath -> TypedTerm SubtermAttribute
+ Hydra.Dsl.Paths: subtermAttributeWithTarget :: TypedTerm SubtermAttribute -> TypedTerm TermAttribute -> TypedTerm SubtermAttribute
+ Hydra.Dsl.Paths: subtermLinkAttribute :: TypedTerm SubtermAttribute -> TypedTerm SubtermLink
+ Hydra.Dsl.Paths: subtermLinkEdge :: TypedTerm SubtermEdge -> TypedTerm SubtermLink
+ Hydra.Dsl.Paths: subtermLinkProperty :: TypedTerm SubtermProperty -> TypedTerm SubtermLink
+ Hydra.Dsl.Paths: subtermLinkSubtermLink :: TypedName SubtermLink
+ Hydra.Dsl.Paths: subtermNodeLinks :: TypedTerm SubtermNode -> TypedTerm [SubtermLink]
+ Hydra.Dsl.Paths: subtermNodeType :: TypedTerm SubtermNode -> TypedTerm TypeScheme
+ Hydra.Dsl.Paths: subtermNodeWithLinks :: TypedTerm SubtermNode -> TypedTerm [SubtermLink] -> TypedTerm SubtermNode
+ Hydra.Dsl.Paths: subtermNodeWithType :: TypedTerm SubtermNode -> TypedTerm TypeScheme -> TypedTerm SubtermNode
+ Hydra.Dsl.Paths: subtermProperty :: TypedTerm SubtermPath -> TypedTerm Term -> TypedTerm SubtermProperty
+ Hydra.Dsl.Paths: subtermPropertyPath :: TypedTerm SubtermProperty -> TypedTerm SubtermPath
+ Hydra.Dsl.Paths: subtermPropertySubtermProperty :: TypedName SubtermProperty
+ Hydra.Dsl.Paths: subtermPropertyTarget :: TypedTerm SubtermProperty -> TypedTerm Term
+ Hydra.Dsl.Paths: subtermPropertyWithPath :: TypedTerm SubtermProperty -> TypedTerm SubtermPath -> TypedTerm SubtermProperty
+ Hydra.Dsl.Paths: subtermPropertyWithTarget :: TypedTerm SubtermProperty -> TypedTerm Term -> TypedTerm SubtermProperty
+ Hydra.Dsl.Paths: subtermStepAnnotatedAnnotation :: TypedTerm SubtermStep
+ Hydra.Dsl.Paths: subtermStepCasesCase :: TypedTerm Name -> TypedTerm SubtermStep
+ Hydra.Dsl.Paths: subtermStepCasesDefault :: TypedTerm SubtermStep
+ Hydra.Dsl.Paths: subtermStepEitherLeft :: TypedTerm SubtermStep
+ Hydra.Dsl.Paths: subtermStepEitherRight :: TypedTerm SubtermStep
+ Hydra.Dsl.Paths: subtermStepInjectField :: TypedTerm Name -> TypedTerm SubtermStep
+ Hydra.Dsl.Paths: subtermStepOptionalGiven :: TypedTerm SubtermStep
+ Hydra.Dsl.Paths: subtermStepPairFirst :: TypedTerm SubtermStep
+ Hydra.Dsl.Paths: subtermStepPairSecond :: TypedTerm SubtermStep
+ Hydra.Dsl.Paths: subtermStepTypeApplicationBody :: TypedTerm SubtermStep
+ Hydra.Dsl.Paths: subtermStepWrapBody :: TypedTerm SubtermStep
+ Hydra.Dsl.Paths: subtypeAttribute :: TypedTerm SubtypePath -> TypedTerm TypeAttribute -> TypedTerm SubtypeAttribute
+ Hydra.Dsl.Paths: subtypeAttributePath :: TypedTerm SubtypeAttribute -> TypedTerm SubtypePath
+ Hydra.Dsl.Paths: subtypeAttributeSubtypeAttribute :: TypedName SubtypeAttribute
+ Hydra.Dsl.Paths: subtypeAttributeTarget :: TypedTerm SubtypeAttribute -> TypedTerm TypeAttribute
+ Hydra.Dsl.Paths: subtypeAttributeWithPath :: TypedTerm SubtypeAttribute -> TypedTerm SubtypePath -> TypedTerm SubtypeAttribute
+ Hydra.Dsl.Paths: subtypeAttributeWithTarget :: TypedTerm SubtypeAttribute -> TypedTerm TypeAttribute -> TypedTerm SubtypeAttribute
+ Hydra.Dsl.Paths: subtypeLinkAttribute :: TypedTerm SubtypeAttribute -> TypedTerm SubtypeLink
+ Hydra.Dsl.Paths: subtypeLinkEdge :: TypedTerm SubtypeEdge -> TypedTerm SubtypeLink
+ Hydra.Dsl.Paths: subtypeLinkProperty :: TypedTerm SubtypeProperty -> TypedTerm SubtypeLink
+ Hydra.Dsl.Paths: subtypeLinkSubtypeLink :: TypedName SubtypeLink
+ Hydra.Dsl.Paths: subtypeNodeLinks :: TypedTerm SubtypeNode -> TypedTerm [SubtypeLink]
+ Hydra.Dsl.Paths: subtypeNodeWithLinks :: TypedTerm SubtypeNode -> TypedTerm [SubtypeLink] -> TypedTerm SubtypeNode
+ Hydra.Dsl.Paths: subtypeProperty :: TypedTerm SubtypePath -> TypedTerm Type -> TypedTerm SubtypeProperty
+ Hydra.Dsl.Paths: subtypePropertyPath :: TypedTerm SubtypeProperty -> TypedTerm SubtypePath
+ Hydra.Dsl.Paths: subtypePropertySubtypeProperty :: TypedName SubtypeProperty
+ Hydra.Dsl.Paths: subtypePropertyTarget :: TypedTerm SubtypeProperty -> TypedTerm Type
+ Hydra.Dsl.Paths: subtypePropertyWithPath :: TypedTerm SubtypeProperty -> TypedTerm SubtypePath -> TypedTerm SubtypeProperty
+ Hydra.Dsl.Paths: subtypePropertyWithTarget :: TypedTerm SubtypeProperty -> TypedTerm Type -> TypedTerm SubtypeProperty
+ Hydra.Dsl.Paths: subtypeStepEffectValue :: TypedTerm SubtypeStep
+ Hydra.Dsl.Paths: subtypeStepWrapBody :: TypedTerm SubtypeStep
+ Hydra.Dsl.Paths: termAttributeCasesTypeName :: TypedTerm Name -> TypedTerm TermAttribute
+ Hydra.Dsl.Paths: termAttributeInjectTypeName :: TypedTerm Name -> TypedTerm TermAttribute
+ Hydra.Dsl.Paths: termAttributeLambdaDomainGiven :: TypedTerm Type -> TypedTerm TermAttribute
+ Hydra.Dsl.Paths: termAttributeLambdaParameter :: TypedTerm Name -> TypedTerm TermAttribute
+ Hydra.Dsl.Paths: termAttributeLetBindingTypeSchemeGiven :: TypedTerm (Name, TypeScheme) -> TypedTerm TermAttribute
+ Hydra.Dsl.Paths: termAttributeProjectFieldName :: TypedTerm Name -> TypedTerm TermAttribute
+ Hydra.Dsl.Paths: termAttributeProjectTypeName :: TypedTerm Name -> TypedTerm TermAttribute
+ Hydra.Dsl.Paths: termAttributeRecordTypeName :: TypedTerm Name -> TypedTerm TermAttribute
+ Hydra.Dsl.Paths: termAttributeTermAttribute :: TypedName TermAttribute
+ Hydra.Dsl.Paths: termAttributeTypeApplicationType :: TypedTerm Type -> TypedTerm TermAttribute
+ Hydra.Dsl.Paths: termAttributeTypeLambdaParameter :: TypedTerm Name -> TypedTerm TermAttribute
+ Hydra.Dsl.Paths: termAttributeWrapTypeName :: TypedTerm Name -> TypedTerm TermAttribute
+ Hydra.Dsl.Paths: typeAttributeAnnotatedAnnotation :: TypedTerm Term -> TypedTerm TypeAttribute
+ Hydra.Dsl.Paths: typeAttributeForallParameter :: TypedTerm Name -> TypedTerm TypeAttribute
+ Hydra.Dsl.Paths: typeAttributeTypeAttribute :: TypedName TypeAttribute
+ Hydra.Dsl.Rewriting: subtypesWithSteps :: TypedTerm Type -> TypedTerm [(SubtypeStep, Type)]
+ Hydra.Dsls: signatureIsVoidFree :: TermSignature -> Bool
+ Hydra.Dsls: typeIsVoidFree :: Type -> Bool
+ Hydra.Encode.Paths: subtermAttribute :: SubtermAttribute -> Term
+ Hydra.Encode.Paths: subtermLink :: SubtermLink -> Term
+ Hydra.Encode.Paths: subtermProperty :: SubtermProperty -> Term
+ Hydra.Encode.Paths: subtypeAttribute :: SubtypeAttribute -> Term
+ Hydra.Encode.Paths: subtypeLink :: SubtypeLink -> Term
+ Hydra.Encode.Paths: subtypeProperty :: SubtypeProperty -> Term
+ Hydra.Encode.Paths: termAttribute :: TermAttribute -> Term
+ Hydra.Encode.Paths: typeAttribute :: TypeAttribute -> Term
+ Hydra.Lib.Eithers: left :: PrimitiveDefinition
+ Hydra.Lib.Eithers: right :: PrimitiveDefinition
+ Hydra.Lib.Functions: absurd :: PrimitiveDefinition
+ Hydra.Lib.Lists: isEmpty :: PrimitiveDefinition
+ Hydra.Lib.Literals: parseBigint :: PrimitiveDefinition
+ Hydra.Lib.Literals: parseDecimal :: PrimitiveDefinition
+ Hydra.Lib.Literals: parseFloat32 :: PrimitiveDefinition
+ Hydra.Lib.Literals: parseFloat64 :: PrimitiveDefinition
+ Hydra.Lib.Literals: parseInt16 :: PrimitiveDefinition
+ Hydra.Lib.Literals: parseInt32 :: PrimitiveDefinition
+ Hydra.Lib.Literals: parseInt64 :: PrimitiveDefinition
+ Hydra.Lib.Literals: parseInt8 :: PrimitiveDefinition
+ Hydra.Lib.Literals: parseUint16 :: PrimitiveDefinition
+ Hydra.Lib.Literals: parseUint32 :: PrimitiveDefinition
+ Hydra.Lib.Literals: parseUint64 :: PrimitiveDefinition
+ Hydra.Lib.Literals: parseUint8 :: PrimitiveDefinition
+ Hydra.Lib.Literals: printBigint :: PrimitiveDefinition
+ Hydra.Lib.Literals: printDecimal :: PrimitiveDefinition
+ Hydra.Lib.Literals: printFloat32 :: PrimitiveDefinition
+ Hydra.Lib.Literals: printFloat64 :: PrimitiveDefinition
+ Hydra.Lib.Literals: printInt16 :: PrimitiveDefinition
+ Hydra.Lib.Literals: printInt32 :: PrimitiveDefinition
+ Hydra.Lib.Literals: printInt64 :: PrimitiveDefinition
+ Hydra.Lib.Literals: printInt8 :: PrimitiveDefinition
+ Hydra.Lib.Literals: printUint16 :: PrimitiveDefinition
+ Hydra.Lib.Literals: printUint32 :: PrimitiveDefinition
+ Hydra.Lib.Literals: printUint64 :: PrimitiveDefinition
+ Hydra.Lib.Literals: printUint8 :: PrimitiveDefinition
+ Hydra.Lib.Maps: isEmpty :: PrimitiveDefinition
+ Hydra.Lib.Optionals: given :: PrimitiveDefinition
+ Hydra.Lib.Pairs: pair :: PrimitiveDefinition
+ Hydra.Lib.Sets: isEmpty :: PrimitiveDefinition
+ Hydra.Lib.Strings: isEmpty :: PrimitiveDefinition
+ Hydra.Overlay.Haskell.Dsl.Typed.Phantoms: deprecatedSince :: String -> String -> PrimitiveDefinition -> PrimitiveDefinition
+ Hydra.Overlay.Haskell.Lib.Eithers: left :: a -> Either a b
+ Hydra.Overlay.Haskell.Lib.Eithers: right :: b -> Either a b
+ Hydra.Overlay.Haskell.Lib.Functions: absurd :: a -> b
+ Hydra.Overlay.Haskell.Lib.Lists: isEmpty :: [a] -> Bool
+ Hydra.Overlay.Haskell.Lib.Literals: parseBigint :: String -> Maybe Integer
+ Hydra.Overlay.Haskell.Lib.Literals: parseDecimal :: String -> Maybe Scientific
+ Hydra.Overlay.Haskell.Lib.Literals: parseFloat32 :: String -> Maybe Float
+ Hydra.Overlay.Haskell.Lib.Literals: parseFloat64 :: String -> Maybe Double
+ Hydra.Overlay.Haskell.Lib.Literals: parseInt16 :: String -> Maybe Int16
+ Hydra.Overlay.Haskell.Lib.Literals: parseInt32 :: String -> Maybe Int
+ Hydra.Overlay.Haskell.Lib.Literals: parseInt64 :: String -> Maybe Int64
+ Hydra.Overlay.Haskell.Lib.Literals: parseInt8 :: String -> Maybe Int8
+ Hydra.Overlay.Haskell.Lib.Literals: parseUint16 :: String -> Maybe Int
+ Hydra.Overlay.Haskell.Lib.Literals: parseUint32 :: String -> Maybe Int64
+ Hydra.Overlay.Haskell.Lib.Literals: parseUint64 :: String -> Maybe Integer
+ Hydra.Overlay.Haskell.Lib.Literals: parseUint8 :: String -> Maybe Int16
+ Hydra.Overlay.Haskell.Lib.Literals: printBigint :: Integer -> String
+ Hydra.Overlay.Haskell.Lib.Literals: printDecimal :: Scientific -> String
+ Hydra.Overlay.Haskell.Lib.Literals: printFloat32 :: Float -> String
+ Hydra.Overlay.Haskell.Lib.Literals: printFloat64 :: Double -> String
+ Hydra.Overlay.Haskell.Lib.Literals: printInt16 :: Int16 -> String
+ Hydra.Overlay.Haskell.Lib.Literals: printInt32 :: Int -> String
+ Hydra.Overlay.Haskell.Lib.Literals: printInt64 :: Int64 -> String
+ Hydra.Overlay.Haskell.Lib.Literals: printInt8 :: Int8 -> String
+ Hydra.Overlay.Haskell.Lib.Literals: printUint16 :: Int -> String
+ Hydra.Overlay.Haskell.Lib.Literals: printUint32 :: Int64 -> String
+ Hydra.Overlay.Haskell.Lib.Literals: printUint64 :: Integer -> String
+ Hydra.Overlay.Haskell.Lib.Literals: printUint8 :: Int16 -> String
+ Hydra.Overlay.Haskell.Lib.Maps: isEmpty :: Map k v -> Bool
+ Hydra.Overlay.Haskell.Lib.Optionals: given :: a -> Maybe a
+ Hydra.Overlay.Haskell.Lib.Pairs: pair :: a -> b -> (a, b)
+ Hydra.Overlay.Haskell.Lib.Sets: isEmpty :: Set x -> Bool
+ Hydra.Overlay.Haskell.Lib.Strings: isEmpty :: String -> Bool
+ Hydra.Paths: SubtermAttribute :: SubtermPath -> TermAttribute -> SubtermAttribute
+ Hydra.Paths: SubtermLinkAttribute :: SubtermAttribute -> SubtermLink
+ Hydra.Paths: SubtermLinkEdge :: SubtermEdge -> SubtermLink
+ Hydra.Paths: SubtermLinkProperty :: SubtermProperty -> SubtermLink
+ Hydra.Paths: SubtermProperty :: SubtermPath -> Term -> SubtermProperty
+ Hydra.Paths: SubtermStepAnnotatedAnnotation :: SubtermStep
+ Hydra.Paths: SubtermStepCasesCase :: Name -> SubtermStep
+ Hydra.Paths: SubtermStepCasesDefault :: SubtermStep
+ Hydra.Paths: SubtermStepEitherLeft :: SubtermStep
+ Hydra.Paths: SubtermStepEitherRight :: SubtermStep
+ Hydra.Paths: SubtermStepInjectField :: Name -> SubtermStep
+ Hydra.Paths: SubtermStepOptionalGiven :: SubtermStep
+ Hydra.Paths: SubtermStepPairFirst :: SubtermStep
+ Hydra.Paths: SubtermStepPairSecond :: SubtermStep
+ Hydra.Paths: SubtermStepTypeApplicationBody :: SubtermStep
+ Hydra.Paths: SubtermStepWrapBody :: SubtermStep
+ Hydra.Paths: SubtypeAttribute :: SubtypePath -> TypeAttribute -> SubtypeAttribute
+ Hydra.Paths: SubtypeLinkAttribute :: SubtypeAttribute -> SubtypeLink
+ Hydra.Paths: SubtypeLinkEdge :: SubtypeEdge -> SubtypeLink
+ Hydra.Paths: SubtypeLinkProperty :: SubtypeProperty -> SubtypeLink
+ Hydra.Paths: SubtypeProperty :: SubtypePath -> Type -> SubtypeProperty
+ Hydra.Paths: SubtypeStepEffectValue :: SubtypeStep
+ Hydra.Paths: SubtypeStepWrapBody :: SubtypeStep
+ Hydra.Paths: TermAttributeCasesTypeName :: Name -> TermAttribute
+ Hydra.Paths: TermAttributeInjectTypeName :: Name -> TermAttribute
+ Hydra.Paths: TermAttributeLambdaDomainGiven :: Type -> TermAttribute
+ Hydra.Paths: TermAttributeLambdaParameter :: Name -> TermAttribute
+ Hydra.Paths: TermAttributeLetBindingTypeSchemeGiven :: (Name, TypeScheme) -> TermAttribute
+ Hydra.Paths: TermAttributeProjectFieldName :: Name -> TermAttribute
+ Hydra.Paths: TermAttributeProjectTypeName :: Name -> TermAttribute
+ Hydra.Paths: TermAttributeRecordTypeName :: Name -> TermAttribute
+ Hydra.Paths: TermAttributeTypeApplicationType :: Type -> TermAttribute
+ Hydra.Paths: TermAttributeTypeLambdaParameter :: Name -> TermAttribute
+ Hydra.Paths: TermAttributeWrapTypeName :: Name -> TermAttribute
+ Hydra.Paths: TypeAttributeAnnotatedAnnotation :: Term -> TypeAttribute
+ Hydra.Paths: TypeAttributeForallParameter :: Name -> TypeAttribute
+ Hydra.Paths: [subtermAttributePath] :: SubtermAttribute -> SubtermPath
+ Hydra.Paths: [subtermAttributeTarget] :: SubtermAttribute -> TermAttribute
+ Hydra.Paths: [subtermNodeLinks] :: SubtermNode -> [SubtermLink]
+ Hydra.Paths: [subtermNodeType] :: SubtermNode -> TypeScheme
+ Hydra.Paths: [subtermPropertyPath] :: SubtermProperty -> SubtermPath
+ Hydra.Paths: [subtermPropertyTarget] :: SubtermProperty -> Term
+ Hydra.Paths: [subtypeAttributePath] :: SubtypeAttribute -> SubtypePath
+ Hydra.Paths: [subtypeAttributeTarget] :: SubtypeAttribute -> TypeAttribute
+ Hydra.Paths: [subtypeNodeLinks] :: SubtypeNode -> [SubtypeLink]
+ Hydra.Paths: [subtypePropertyPath] :: SubtypeProperty -> SubtypePath
+ Hydra.Paths: [subtypePropertyTarget] :: SubtypeProperty -> Type
+ Hydra.Paths: _SubtermAttribute :: Name
+ Hydra.Paths: _SubtermAttribute_path :: Name
+ Hydra.Paths: _SubtermAttribute_target :: Name
+ Hydra.Paths: _SubtermLink :: Name
+ Hydra.Paths: _SubtermLink_attribute :: Name
+ Hydra.Paths: _SubtermLink_edge :: Name
+ Hydra.Paths: _SubtermLink_property :: Name
+ Hydra.Paths: _SubtermNode_links :: Name
+ Hydra.Paths: _SubtermNode_type :: Name
+ Hydra.Paths: _SubtermProperty :: Name
+ Hydra.Paths: _SubtermProperty_path :: Name
+ Hydra.Paths: _SubtermProperty_target :: Name
+ Hydra.Paths: _SubtermStep_annotatedAnnotation :: Name
+ Hydra.Paths: _SubtermStep_casesCase :: Name
+ Hydra.Paths: _SubtermStep_casesDefault :: Name
+ Hydra.Paths: _SubtermStep_eitherLeft :: Name
+ Hydra.Paths: _SubtermStep_eitherRight :: Name
+ Hydra.Paths: _SubtermStep_injectField :: Name
+ Hydra.Paths: _SubtermStep_optionalGiven :: Name
+ Hydra.Paths: _SubtermStep_pairFirst :: Name
+ Hydra.Paths: _SubtermStep_pairSecond :: Name
+ Hydra.Paths: _SubtermStep_typeApplicationBody :: Name
+ Hydra.Paths: _SubtermStep_wrapBody :: Name
+ Hydra.Paths: _SubtypeAttribute :: Name
+ Hydra.Paths: _SubtypeAttribute_path :: Name
+ Hydra.Paths: _SubtypeAttribute_target :: Name
+ Hydra.Paths: _SubtypeLink :: Name
+ Hydra.Paths: _SubtypeLink_attribute :: Name
+ Hydra.Paths: _SubtypeLink_edge :: Name
+ Hydra.Paths: _SubtypeLink_property :: Name
+ Hydra.Paths: _SubtypeNode_links :: Name
+ Hydra.Paths: _SubtypeProperty :: Name
+ Hydra.Paths: _SubtypeProperty_path :: Name
+ Hydra.Paths: _SubtypeProperty_target :: Name
+ Hydra.Paths: _SubtypeStep_effectValue :: Name
+ Hydra.Paths: _SubtypeStep_wrapBody :: Name
+ Hydra.Paths: _TermAttribute :: Name
+ Hydra.Paths: _TermAttribute_casesTypeName :: Name
+ Hydra.Paths: _TermAttribute_injectTypeName :: Name
+ Hydra.Paths: _TermAttribute_lambdaDomainGiven :: Name
+ Hydra.Paths: _TermAttribute_lambdaParameter :: Name
+ Hydra.Paths: _TermAttribute_letBindingTypeSchemeGiven :: Name
+ Hydra.Paths: _TermAttribute_projectFieldName :: Name
+ Hydra.Paths: _TermAttribute_projectTypeName :: Name
+ Hydra.Paths: _TermAttribute_recordTypeName :: Name
+ Hydra.Paths: _TermAttribute_typeApplicationType :: Name
+ Hydra.Paths: _TermAttribute_typeLambdaParameter :: Name
+ Hydra.Paths: _TermAttribute_wrapTypeName :: Name
+ Hydra.Paths: _TypeAttribute :: Name
+ Hydra.Paths: _TypeAttribute_annotatedAnnotation :: Name
+ Hydra.Paths: _TypeAttribute_forallParameter :: Name
+ Hydra.Paths: data SubtermAttribute
+ Hydra.Paths: data SubtermLink
+ Hydra.Paths: data SubtermProperty
+ Hydra.Paths: data SubtypeAttribute
+ Hydra.Paths: data SubtypeLink
+ Hydra.Paths: data SubtypeProperty
+ Hydra.Paths: data TermAttribute
+ Hydra.Paths: data TypeAttribute
+ Hydra.Paths: instance GHC.Classes.Eq Hydra.Paths.SubtermAttribute
+ Hydra.Paths: instance GHC.Classes.Eq Hydra.Paths.SubtermLink
+ Hydra.Paths: instance GHC.Classes.Eq Hydra.Paths.SubtermProperty
+ Hydra.Paths: instance GHC.Classes.Eq Hydra.Paths.SubtypeAttribute
+ Hydra.Paths: instance GHC.Classes.Eq Hydra.Paths.SubtypeLink
+ Hydra.Paths: instance GHC.Classes.Eq Hydra.Paths.SubtypeProperty
+ Hydra.Paths: instance GHC.Classes.Eq Hydra.Paths.TermAttribute
+ Hydra.Paths: instance GHC.Classes.Eq Hydra.Paths.TypeAttribute
+ Hydra.Paths: instance GHC.Classes.Ord Hydra.Paths.SubtermAttribute
+ Hydra.Paths: instance GHC.Classes.Ord Hydra.Paths.SubtermLink
+ Hydra.Paths: instance GHC.Classes.Ord Hydra.Paths.SubtermProperty
+ Hydra.Paths: instance GHC.Classes.Ord Hydra.Paths.SubtypeAttribute
+ Hydra.Paths: instance GHC.Classes.Ord Hydra.Paths.SubtypeLink
+ Hydra.Paths: instance GHC.Classes.Ord Hydra.Paths.SubtypeProperty
+ Hydra.Paths: instance GHC.Classes.Ord Hydra.Paths.TermAttribute
+ Hydra.Paths: instance GHC.Classes.Ord Hydra.Paths.TypeAttribute
+ Hydra.Paths: instance GHC.Read.Read Hydra.Paths.SubtermAttribute
+ Hydra.Paths: instance GHC.Read.Read Hydra.Paths.SubtermLink
+ Hydra.Paths: instance GHC.Read.Read Hydra.Paths.SubtermProperty
+ Hydra.Paths: instance GHC.Read.Read Hydra.Paths.SubtypeAttribute
+ Hydra.Paths: instance GHC.Read.Read Hydra.Paths.SubtypeLink
+ Hydra.Paths: instance GHC.Read.Read Hydra.Paths.SubtypeProperty
+ Hydra.Paths: instance GHC.Read.Read Hydra.Paths.TermAttribute
+ Hydra.Paths: instance GHC.Read.Read Hydra.Paths.TypeAttribute
+ Hydra.Paths: instance GHC.Show.Show Hydra.Paths.SubtermAttribute
+ Hydra.Paths: instance GHC.Show.Show Hydra.Paths.SubtermLink
+ Hydra.Paths: instance GHC.Show.Show Hydra.Paths.SubtermProperty
+ Hydra.Paths: instance GHC.Show.Show Hydra.Paths.SubtypeAttribute
+ Hydra.Paths: instance GHC.Show.Show Hydra.Paths.SubtypeLink
+ Hydra.Paths: instance GHC.Show.Show Hydra.Paths.SubtypeProperty
+ Hydra.Paths: instance GHC.Show.Show Hydra.Paths.TermAttribute
+ Hydra.Paths: instance GHC.Show.Show Hydra.Paths.TypeAttribute
+ Hydra.Print.Emacs.Regex: printCodePoint :: Int -> String
+ Hydra.Print.Paths: parseSubtermPath :: String -> Maybe SubtermPath
+ Hydra.Print.Paths: parseSubtermStep :: String -> Maybe SubtermStep
+ Hydra.Print.Paths: parseSubtypePath :: String -> Maybe SubtypePath
+ Hydra.Print.Paths: parseSubtypeStep :: String -> Maybe SubtypeStep
+ Hydra.Print.Paths: subtermPath :: SubtermPath -> String
+ Hydra.Print.Paths: subtypePath :: SubtypePath -> String
+ Hydra.Print.Paths: subtypeStep :: SubtypeStep -> String
+ Hydra.Print.Pcre.Regex: printCodePoint :: Int -> String
+ Hydra.Print.Posix.Regex: printCodePoint :: Int -> String
+ Hydra.Print.Regex: printCodePoint :: Int -> String
+ Hydra.Rewriting: subtypesWithSteps :: Type -> [(SubtypeStep, Type)]
+ Hydra.Shredding: shredGraph :: Graph -> Either Error SubtermGraph
+ Hydra.Shredding: shredSchema :: Map Name Type -> Either Error SubtypeGraph
+ Hydra.Shredding: shredTerm :: Graph -> Name -> TypeScheme -> Term -> Either Error SubtermNode
+ Hydra.Shredding: shredTermLinks :: Graph -> Set Name -> SubtermPath -> Term -> Either Error [SubtermLink]
+ Hydra.Shredding: shredType :: Map Name t0 -> Name -> Type -> Either Error SubtypeNode
+ Hydra.Shredding: shredTypeLinks :: Map Name t0 -> Set Name -> SubtypePath -> Type -> Either Error [SubtypeLink]
+ Hydra.Shredding: termAttributes :: SubtermPath -> Term -> [SubtermAttribute]
+ Hydra.Shredding: typeAttributes :: SubtypePath -> Type -> [SubtypeAttribute]
- Hydra.Core: TypeScheme :: [Name] -> Type -> Maybe (Map Name TypeVariableConstraints) -> TypeScheme
+ Hydra.Core: TypeScheme :: [Name] -> Type -> Map Name TypeVariableConstraints -> TypeScheme
- Hydra.Core: TypeVariableConstraints :: [TypeClassConstraint] -> TypeVariableConstraints
+ Hydra.Core: TypeVariableConstraints :: Set TypeClassConstraint -> TypeVariableConstraints
- Hydra.Core: [typeSchemeConstraints] :: TypeScheme -> Maybe (Map Name TypeVariableConstraints)
+ Hydra.Core: [typeSchemeConstraints] :: TypeScheme -> Map Name TypeVariableConstraints
- Hydra.Core: [typeVariableConstraintsClasses] :: TypeVariableConstraints -> [TypeClassConstraint]
+ Hydra.Core: [typeVariableConstraintsClasses] :: TypeVariableConstraints -> Set TypeClassConstraint
- Hydra.Dsl.Annotations: aggregateAnnotations :: Ord t2 => TypedTerm (t0 -> Maybe t1) -> TypedTerm (t1 -> t0) -> TypedTerm (t1 -> Map t2 t3) -> TypedTerm t0 -> TypedTerm (Map t2 t3)
+ Hydra.Dsl.Annotations: aggregateAnnotations :: TypedTerm (t0 -> Maybe t1) -> TypedTerm (t1 -> t0) -> TypedTerm (t1 -> Map t2 t3) -> TypedTerm t0 -> TypedTerm (Map t2 t3)
- Hydra.Dsl.Annotations: setAnnotation :: Ord t0 => TypedTerm t0 -> TypedTerm (Maybe t1) -> TypedTerm (Map t0 t1) -> TypedTerm (Map t0 t1)
+ Hydra.Dsl.Annotations: setAnnotation :: TypedTerm t0 -> TypedTerm (Maybe t1) -> TypedTerm (Map t0 t1) -> TypedTerm (Map t0 t1)
- Hydra.Dsl.Core: typeScheme :: TypedTerm [Name] -> TypedTerm Type -> TypedTerm (Maybe (Map Name TypeVariableConstraints)) -> TypedTerm TypeScheme
+ Hydra.Dsl.Core: typeScheme :: TypedTerm [Name] -> TypedTerm Type -> TypedTerm (Map Name TypeVariableConstraints) -> TypedTerm TypeScheme
- Hydra.Dsl.Core: typeSchemeConstraints :: TypedTerm TypeScheme -> TypedTerm (Maybe (Map Name TypeVariableConstraints))
+ Hydra.Dsl.Core: typeSchemeConstraints :: TypedTerm TypeScheme -> TypedTerm (Map Name TypeVariableConstraints)
- Hydra.Dsl.Core: typeSchemeWithConstraints :: TypedTerm TypeScheme -> TypedTerm (Maybe (Map Name TypeVariableConstraints)) -> TypedTerm TypeScheme
+ Hydra.Dsl.Core: typeSchemeWithConstraints :: TypedTerm TypeScheme -> TypedTerm (Map Name TypeVariableConstraints) -> TypedTerm TypeScheme
- Hydra.Dsl.Core: typeVariableConstraints :: TypedTerm [TypeClassConstraint] -> TypedTerm TypeVariableConstraints
+ Hydra.Dsl.Core: typeVariableConstraints :: TypedTerm (Set TypeClassConstraint) -> TypedTerm TypeVariableConstraints
- Hydra.Dsl.Core: typeVariableConstraintsClasses :: TypedTerm TypeVariableConstraints -> TypedTerm [TypeClassConstraint]
+ Hydra.Dsl.Core: typeVariableConstraintsClasses :: TypedTerm TypeVariableConstraints -> TypedTerm (Set TypeClassConstraint)
- Hydra.Dsl.Core: typeVariableConstraintsWithClasses :: TypedTerm TypeVariableConstraints -> TypedTerm [TypeClassConstraint] -> TypedTerm TypeVariableConstraints
+ Hydra.Dsl.Core: typeVariableConstraintsWithClasses :: TypedTerm TypeVariableConstraints -> TypedTerm (Set TypeClassConstraint) -> TypedTerm TypeVariableConstraints
- Hydra.Dsl.Dependencies: typeNamesInType :: Ord t0 => TypedTerm Type -> TypedTerm (Set t0)
+ Hydra.Dsl.Dependencies: typeNamesInType :: TypedTerm Type -> TypedTerm (Set t0)
- Hydra.Dsl.Extract.Json: opt :: Ord t0 => TypedTerm t0 -> TypedTerm (Map t0 t1) -> TypedTerm (Maybe t1)
+ Hydra.Dsl.Extract.Json: opt :: TypedTerm t0 -> TypedTerm (Map t0 t1) -> TypedTerm (Maybe t1)
- Hydra.Dsl.Extract.Json: optArray :: Ord t0 => TypedTerm t0 -> TypedTerm (Map t0 Value) -> TypedTerm (Either String (Maybe [Value]))
+ Hydra.Dsl.Extract.Json: optArray :: TypedTerm t0 -> TypedTerm (Map t0 Value) -> TypedTerm (Either String (Maybe [Value]))
- Hydra.Dsl.Extract.Json: optString :: Ord t0 => TypedTerm t0 -> TypedTerm (Map t0 Value) -> TypedTerm (Either String (Maybe String))
+ Hydra.Dsl.Extract.Json: optString :: TypedTerm t0 -> TypedTerm (Map t0 Value) -> TypedTerm (Either String (Maybe String))
- Hydra.Dsl.Json.Decoding: decodeOptionalField :: Ord t3 => TypedTerm (t0 -> Either t1 t2) -> TypedTerm t3 -> TypedTerm (Map t3 t0) -> TypedTerm (Either t1 (Maybe t2))
+ Hydra.Dsl.Json.Decoding: decodeOptionalField :: TypedTerm (t0 -> Either t1 t2) -> TypedTerm t3 -> TypedTerm (Map t3 t0) -> TypedTerm (Either t1 (Maybe t2))
- Hydra.Dsl.Lib.Effects: mapSet :: (Ord x, Ord y) => TypedTerm (x -> IO y) -> TypedTerm (Set x) -> TypedTerm (IO (Set y))
+ Hydra.Dsl.Lib.Effects: mapSet :: TypedTerm (x -> IO y) -> TypedTerm (Set x) -> TypedTerm (IO (Set y))
- Hydra.Dsl.Lib.Eithers: mapSet :: (Ord x, Ord y) => TypedTerm (x -> Either z y) -> TypedTerm (Set x) -> TypedTerm (Either z (Set y))
+ Hydra.Dsl.Lib.Eithers: mapSet :: TypedTerm (x -> Either z y) -> TypedTerm (Set x) -> TypedTerm (Either z (Set y))
- Hydra.Dsl.Lib.Lists: mapSet :: (Ord x, Ord y) => TypedTerm (x -> [y]) -> TypedTerm (Set x) -> TypedTerm [Set y]
+ Hydra.Dsl.Lib.Lists: mapSet :: TypedTerm (x -> [y]) -> TypedTerm (Set x) -> TypedTerm [Set y]
- Hydra.Dsl.Lib.Maps: alter :: Ord k => TypedTerm (Maybe v -> Maybe v) -> TypedTerm k -> TypedTerm (Map k v) -> TypedTerm (Map k v)
+ Hydra.Dsl.Lib.Maps: alter :: TypedTerm (Maybe v -> Maybe v) -> TypedTerm k -> TypedTerm (Map k v) -> TypedTerm (Map k v)
- Hydra.Dsl.Lib.Maps: bimap :: (Ord k1, Ord k2) => TypedTerm (k1 -> k2) -> TypedTerm (v1 -> v2) -> TypedTerm (Map k1 v1) -> TypedTerm (Map k2 v2)
+ Hydra.Dsl.Lib.Maps: bimap :: TypedTerm (k1 -> k2) -> TypedTerm (v1 -> v2) -> TypedTerm (Map k1 v1) -> TypedTerm (Map k2 v2)
- Hydra.Dsl.Lib.Maps: delete :: Ord k => TypedTerm k -> TypedTerm (Map k v) -> TypedTerm (Map k v)
+ Hydra.Dsl.Lib.Maps: delete :: TypedTerm k -> TypedTerm (Map k v) -> TypedTerm (Map k v)
- Hydra.Dsl.Lib.Maps: difference :: Ord k => TypedTerm (Map k v) -> TypedTerm (Map k v) -> TypedTerm (Map k v)
+ Hydra.Dsl.Lib.Maps: difference :: TypedTerm (Map k v) -> TypedTerm (Map k v) -> TypedTerm (Map k v)
- Hydra.Dsl.Lib.Maps: elems :: Ord k => TypedTerm (Map k v) -> TypedTerm [v]
+ Hydra.Dsl.Lib.Maps: elems :: TypedTerm (Map k v) -> TypedTerm [v]
- Hydra.Dsl.Lib.Maps: empty :: Ord k => TypedTerm (Map k v)
+ Hydra.Dsl.Lib.Maps: empty :: TypedTerm (Map k v)
- Hydra.Dsl.Lib.Maps: filter :: Ord k => TypedTerm (v -> Bool) -> TypedTerm (Map k v) -> TypedTerm (Map k v)
+ Hydra.Dsl.Lib.Maps: filter :: TypedTerm (v -> Bool) -> TypedTerm (Map k v) -> TypedTerm (Map k v)
- Hydra.Dsl.Lib.Maps: filterWithKey :: Ord k => TypedTerm (k -> v -> Bool) -> TypedTerm (Map k v) -> TypedTerm (Map k v)
+ Hydra.Dsl.Lib.Maps: filterWithKey :: TypedTerm (k -> v -> Bool) -> TypedTerm (Map k v) -> TypedTerm (Map k v)
- Hydra.Dsl.Lib.Maps: findWithDefault :: Ord k => TypedTerm v -> TypedTerm k -> TypedTerm (Map k v) -> TypedTerm v
+ Hydra.Dsl.Lib.Maps: findWithDefault :: TypedTerm v -> TypedTerm k -> TypedTerm (Map k v) -> TypedTerm v
- Hydra.Dsl.Lib.Maps: fromList :: Ord k => TypedTerm [(k, v)] -> TypedTerm (Map k v)
+ Hydra.Dsl.Lib.Maps: fromList :: TypedTerm [(k, v)] -> TypedTerm (Map k v)
- Hydra.Dsl.Lib.Maps: insert :: Ord k => TypedTerm k -> TypedTerm v -> TypedTerm (Map k v) -> TypedTerm (Map k v)
+ Hydra.Dsl.Lib.Maps: insert :: TypedTerm k -> TypedTerm v -> TypedTerm (Map k v) -> TypedTerm (Map k v)
- Hydra.Dsl.Lib.Maps: intersection :: Ord k => TypedTerm (Map k v) -> TypedTerm (Map k v) -> TypedTerm (Map k v)
+ Hydra.Dsl.Lib.Maps: intersection :: TypedTerm (Map k v) -> TypedTerm (Map k v) -> TypedTerm (Map k v)
- Hydra.Dsl.Lib.Maps: keys :: Ord k => TypedTerm (Map k v) -> TypedTerm [k]
+ Hydra.Dsl.Lib.Maps: keys :: TypedTerm (Map k v) -> TypedTerm [k]
- Hydra.Dsl.Lib.Maps: lookup :: Ord k => TypedTerm k -> TypedTerm (Map k v) -> TypedTerm (Maybe v)
+ Hydra.Dsl.Lib.Maps: lookup :: TypedTerm k -> TypedTerm (Map k v) -> TypedTerm (Maybe v)
- Hydra.Dsl.Lib.Maps: map :: Ord k => TypedTerm (v1 -> v2) -> TypedTerm (Map k v1) -> TypedTerm (Map k v2)
+ Hydra.Dsl.Lib.Maps: map :: TypedTerm (v1 -> v2) -> TypedTerm (Map k v1) -> TypedTerm (Map k v2)
- Hydra.Dsl.Lib.Maps: mapKeys :: (Ord k1, Ord k2) => TypedTerm (k1 -> k2) -> TypedTerm (Map k1 v) -> TypedTerm (Map k2 v)
+ Hydra.Dsl.Lib.Maps: mapKeys :: TypedTerm (k1 -> k2) -> TypedTerm (Map k1 v) -> TypedTerm (Map k2 v)
- Hydra.Dsl.Lib.Maps: member :: Ord k => TypedTerm k -> TypedTerm (Map k v) -> TypedTerm Bool
+ Hydra.Dsl.Lib.Maps: member :: TypedTerm k -> TypedTerm (Map k v) -> TypedTerm Bool
- Hydra.Dsl.Lib.Maps: singleton :: Ord k => TypedTerm k -> TypedTerm v -> TypedTerm (Map k v)
+ Hydra.Dsl.Lib.Maps: singleton :: TypedTerm k -> TypedTerm v -> TypedTerm (Map k v)
- Hydra.Dsl.Lib.Maps: size :: Ord k => TypedTerm (Map k v) -> TypedTerm Int
+ Hydra.Dsl.Lib.Maps: size :: TypedTerm (Map k v) -> TypedTerm Int
- Hydra.Dsl.Lib.Maps: toList :: Ord k => TypedTerm (Map k v) -> TypedTerm [(k, v)]
+ Hydra.Dsl.Lib.Maps: toList :: TypedTerm (Map k v) -> TypedTerm [(k, v)]
- Hydra.Dsl.Lib.Maps: union :: Ord k => TypedTerm (Map k v) -> TypedTerm (Map k v) -> TypedTerm (Map k v)
+ Hydra.Dsl.Lib.Maps: union :: TypedTerm (Map k v) -> TypedTerm (Map k v) -> TypedTerm (Map k v)
- Hydra.Dsl.Lib.Maps: unions :: Ord k => TypedTerm [Map k v] -> TypedTerm (Map k v)
+ Hydra.Dsl.Lib.Maps: unions :: TypedTerm [Map k v] -> TypedTerm (Map k v)
- Hydra.Dsl.Lib.Optionals: mapSet :: (Ord x, Ord y) => TypedTerm (x -> Maybe y) -> TypedTerm (Set x) -> TypedTerm (Maybe (Set y))
+ Hydra.Dsl.Lib.Optionals: mapSet :: TypedTerm (x -> Maybe y) -> TypedTerm (Set x) -> TypedTerm (Maybe (Set y))
- Hydra.Dsl.Lib.Sets: delete :: Ord x => TypedTerm x -> TypedTerm (Set x) -> TypedTerm (Set x)
+ Hydra.Dsl.Lib.Sets: delete :: TypedTerm x -> TypedTerm (Set x) -> TypedTerm (Set x)
- Hydra.Dsl.Lib.Sets: difference :: Ord x => TypedTerm (Set x) -> TypedTerm (Set x) -> TypedTerm (Set x)
+ Hydra.Dsl.Lib.Sets: difference :: TypedTerm (Set x) -> TypedTerm (Set x) -> TypedTerm (Set x)
- Hydra.Dsl.Lib.Sets: empty :: Ord x => TypedTerm (Set x)
+ Hydra.Dsl.Lib.Sets: empty :: TypedTerm (Set x)
- Hydra.Dsl.Lib.Sets: filter :: Ord x => TypedTerm (x -> Bool) -> TypedTerm (Set x) -> TypedTerm (Set x)
+ Hydra.Dsl.Lib.Sets: filter :: TypedTerm (x -> Bool) -> TypedTerm (Set x) -> TypedTerm (Set x)
- Hydra.Dsl.Lib.Sets: fromList :: Ord x => TypedTerm [x] -> TypedTerm (Set x)
+ Hydra.Dsl.Lib.Sets: fromList :: TypedTerm [x] -> TypedTerm (Set x)
- Hydra.Dsl.Lib.Sets: insert :: Ord x => TypedTerm x -> TypedTerm (Set x) -> TypedTerm (Set x)
+ Hydra.Dsl.Lib.Sets: insert :: TypedTerm x -> TypedTerm (Set x) -> TypedTerm (Set x)
- Hydra.Dsl.Lib.Sets: intersection :: Ord x => TypedTerm (Set x) -> TypedTerm (Set x) -> TypedTerm (Set x)
+ Hydra.Dsl.Lib.Sets: intersection :: TypedTerm (Set x) -> TypedTerm (Set x) -> TypedTerm (Set x)
- Hydra.Dsl.Lib.Sets: map :: (Ord x, Ord y) => TypedTerm (x -> y) -> TypedTerm (Set x) -> TypedTerm (Set y)
+ Hydra.Dsl.Lib.Sets: map :: TypedTerm (x -> y) -> TypedTerm (Set x) -> TypedTerm (Set y)
- Hydra.Dsl.Lib.Sets: member :: Ord x => TypedTerm x -> TypedTerm (Set x) -> TypedTerm Bool
+ Hydra.Dsl.Lib.Sets: member :: TypedTerm x -> TypedTerm (Set x) -> TypedTerm Bool
- Hydra.Dsl.Lib.Sets: singleton :: Ord x => TypedTerm x -> TypedTerm (Set x)
+ Hydra.Dsl.Lib.Sets: singleton :: TypedTerm x -> TypedTerm (Set x)
- Hydra.Dsl.Lib.Sets: size :: Ord x => TypedTerm (Set x) -> TypedTerm Int
+ Hydra.Dsl.Lib.Sets: size :: TypedTerm (Set x) -> TypedTerm Int
- Hydra.Dsl.Lib.Sets: toList :: Ord x => TypedTerm (Set x) -> TypedTerm [x]
+ Hydra.Dsl.Lib.Sets: toList :: TypedTerm (Set x) -> TypedTerm [x]
- Hydra.Dsl.Lib.Sets: union :: Ord x => TypedTerm (Set x) -> TypedTerm (Set x) -> TypedTerm (Set x)
+ Hydra.Dsl.Lib.Sets: union :: TypedTerm (Set x) -> TypedTerm (Set x) -> TypedTerm (Set x)
- Hydra.Dsl.Lib.Sets: unions :: Ord x => TypedTerm [Set x] -> TypedTerm (Set x)
+ Hydra.Dsl.Lib.Sets: unions :: TypedTerm [Set x] -> TypedTerm (Set x)
- Hydra.Dsl.Paths: subtermEdge :: TypedTerm SubtermNode -> TypedTerm SubtermPath -> TypedTerm SubtermNode -> TypedTerm SubtermEdge
+ Hydra.Dsl.Paths: subtermEdge :: TypedTerm SubtermPath -> TypedTerm Name -> TypedTerm SubtermEdge
- Hydra.Dsl.Paths: subtermEdgeTarget :: TypedTerm SubtermEdge -> TypedTerm SubtermNode
+ Hydra.Dsl.Paths: subtermEdgeTarget :: TypedTerm SubtermEdge -> TypedTerm Name
- Hydra.Dsl.Paths: subtermEdgeWithTarget :: TypedTerm SubtermEdge -> TypedTerm SubtermNode -> TypedTerm SubtermEdge
+ Hydra.Dsl.Paths: subtermEdgeWithTarget :: TypedTerm SubtermEdge -> TypedTerm Name -> TypedTerm SubtermEdge
- Hydra.Dsl.Paths: subtermGraph :: TypedTerm [SubtermNode] -> TypedTerm [SubtermEdge] -> TypedTerm SubtermGraph
+ Hydra.Dsl.Paths: subtermGraph :: TypedTerm [SubtermNode] -> TypedTerm SubtermGraph
- Hydra.Dsl.Paths: subtermNode :: TypedTerm Name -> TypedTerm String -> TypedTerm String -> TypedTerm SubtermNode
+ Hydra.Dsl.Paths: subtermNode :: TypedTerm Name -> TypedTerm TypeScheme -> TypedTerm [SubtermLink] -> TypedTerm SubtermNode
- Hydra.Dsl.Paths: subtypeEdge :: TypedTerm SubtypeNode -> TypedTerm SubtypePath -> TypedTerm SubtypeNode -> TypedTerm SubtypeEdge
+ Hydra.Dsl.Paths: subtypeEdge :: TypedTerm SubtypePath -> TypedTerm Name -> TypedTerm SubtypeEdge
- Hydra.Dsl.Paths: subtypeEdgeTarget :: TypedTerm SubtypeEdge -> TypedTerm SubtypeNode
+ Hydra.Dsl.Paths: subtypeEdgeTarget :: TypedTerm SubtypeEdge -> TypedTerm Name
- Hydra.Dsl.Paths: subtypeEdgeWithTarget :: TypedTerm SubtypeEdge -> TypedTerm SubtypeNode -> TypedTerm SubtypeEdge
+ Hydra.Dsl.Paths: subtypeEdgeWithTarget :: TypedTerm SubtypeEdge -> TypedTerm Name -> TypedTerm SubtypeEdge
- Hydra.Dsl.Paths: subtypeGraph :: TypedTerm [SubtypeNode] -> TypedTerm [SubtypeEdge] -> TypedTerm SubtypeGraph
+ Hydra.Dsl.Paths: subtypeGraph :: TypedTerm [SubtypeNode] -> TypedTerm SubtypeGraph
- Hydra.Dsl.Paths: subtypeNode :: TypedTerm Name -> TypedTerm String -> TypedTerm String -> TypedTerm SubtypeNode
+ Hydra.Dsl.Paths: subtypeNode :: TypedTerm Name -> TypedTerm [SubtypeLink] -> TypedTerm SubtypeNode
- Hydra.Dsl.Refs: encodeMap :: Ord t0 => TypedTerm (t0 -> Term) -> TypedTerm (t1 -> Term) -> TypedTerm (Map t0 t1) -> TypedTerm Term
+ Hydra.Dsl.Refs: encodeMap :: TypedTerm (t0 -> Term) -> TypedTerm (t1 -> Term) -> TypedTerm (Map t0 t1) -> TypedTerm Term
- Hydra.Dsl.Refs: encodeSet :: Ord t0 => TypedTerm (t0 -> Term) -> TypedTerm (Set t0) -> TypedTerm Term
+ Hydra.Dsl.Refs: encodeSet :: TypedTerm (t0 -> Term) -> TypedTerm (Set t0) -> TypedTerm Term
- Hydra.Dsl.Sorting: adjacencyListToMap :: Ord t0 => TypedTerm [(t0, [t1])] -> TypedTerm (Map t0 [t1])
+ Hydra.Dsl.Sorting: adjacencyListToMap :: TypedTerm [(t0, [t1])] -> TypedTerm (Map t0 [t1])
- Hydra.Dsl.Sorting: findReachableNodes :: Ord t0 => TypedTerm (t0 -> Set t0) -> TypedTerm t0 -> TypedTerm (Set t0)
+ Hydra.Dsl.Sorting: findReachableNodes :: TypedTerm (t0 -> Set t0) -> TypedTerm t0 -> TypedTerm (Set t0)
- Hydra.Dsl.Sorting: propagateTags :: Ord t1 => TypedTerm [(t0, [t0])] -> TypedTerm [(t0, [t1])] -> TypedTerm [(t0, Set t1)]
+ Hydra.Dsl.Sorting: propagateTags :: TypedTerm [(t0, [t0])] -> TypedTerm [(t0, [t1])] -> TypedTerm [(t0, Set t1)]
- Hydra.Overlay.Haskell.Dsl.Typed.Core: typeScheme :: TypedTerm [Name] -> TypedTerm Type -> TypedTerm (Maybe (Map Name TypeVariableConstraints)) -> TypedTerm TypeScheme
+ Hydra.Overlay.Haskell.Dsl.Typed.Core: typeScheme :: TypedTerm [Name] -> TypedTerm Type -> TypedTerm (Map Name TypeVariableConstraints) -> TypedTerm TypeScheme
- Hydra.Overlay.Haskell.Dsl.Typed.Core: typeSchemeConstraints :: TypedTerm TypeScheme -> TypedTerm (Maybe (Map Name TypeVariableConstraints))
+ Hydra.Overlay.Haskell.Dsl.Typed.Core: typeSchemeConstraints :: TypedTerm TypeScheme -> TypedTerm (Map Name TypeVariableConstraints)
- Hydra.Overlay.Haskell.Dsl.Typed.Core: typeSchemeWithConstraints :: TypedTerm TypeScheme -> TypedTerm (Maybe (Map Name TypeVariableConstraints)) -> TypedTerm TypeScheme
+ Hydra.Overlay.Haskell.Dsl.Typed.Core: typeSchemeWithConstraints :: TypedTerm TypeScheme -> TypedTerm (Map Name TypeVariableConstraints) -> TypedTerm TypeScheme
- Hydra.Overlay.Haskell.Dsl.Typed.Core: typeVariableConstraints :: TypedTerm [TypeClassConstraint] -> TypedTerm TypeVariableConstraints
+ Hydra.Overlay.Haskell.Dsl.Typed.Core: typeVariableConstraints :: TypedTerm (Set TypeClassConstraint) -> TypedTerm TypeVariableConstraints
- Hydra.Overlay.Haskell.Dsl.Typed.Core: typeVariableConstraintsClasses :: TypedTerm TypeVariableConstraints -> TypedTerm [TypeClassConstraint]
+ Hydra.Overlay.Haskell.Dsl.Typed.Core: typeVariableConstraintsClasses :: TypedTerm TypeVariableConstraints -> TypedTerm (Set TypeClassConstraint)
- Hydra.Overlay.Haskell.Dsl.Typed.Core: typeVariableConstraintsWithClasses :: TypedTerm TypeVariableConstraints -> TypedTerm [TypeClassConstraint] -> TypedTerm TypeVariableConstraints
+ Hydra.Overlay.Haskell.Dsl.Typed.Core: typeVariableConstraintsWithClasses :: TypedTerm TypeVariableConstraints -> TypedTerm (Set TypeClassConstraint) -> TypedTerm TypeVariableConstraints
- Hydra.Paths: SubtermEdge :: SubtermNode -> SubtermPath -> SubtermNode -> SubtermEdge
+ Hydra.Paths: SubtermEdge :: SubtermPath -> Name -> SubtermEdge
- Hydra.Paths: SubtermGraph :: [SubtermNode] -> [SubtermEdge] -> SubtermGraph
+ Hydra.Paths: SubtermGraph :: [SubtermNode] -> SubtermGraph
- Hydra.Paths: SubtermNode :: Name -> String -> String -> SubtermNode
+ Hydra.Paths: SubtermNode :: Name -> TypeScheme -> [SubtermLink] -> SubtermNode
- Hydra.Paths: SubtypeEdge :: SubtypeNode -> SubtypePath -> SubtypeNode -> SubtypeEdge
+ Hydra.Paths: SubtypeEdge :: SubtypePath -> Name -> SubtypeEdge
- Hydra.Paths: SubtypeGraph :: [SubtypeNode] -> [SubtypeEdge] -> SubtypeGraph
+ Hydra.Paths: SubtypeGraph :: [SubtypeNode] -> SubtypeGraph
- Hydra.Paths: SubtypeNode :: Name -> String -> String -> SubtypeNode
+ Hydra.Paths: SubtypeNode :: Name -> [SubtypeLink] -> SubtypeNode
- Hydra.Paths: [subtermEdgeTarget] :: SubtermEdge -> SubtermNode
+ Hydra.Paths: [subtermEdgeTarget] :: SubtermEdge -> Name
- Hydra.Paths: [subtypeEdgeTarget] :: SubtypeEdge -> SubtypeNode
+ Hydra.Paths: [subtypeEdgeTarget] :: SubtypeEdge -> Name
- Hydra.Print.Paths: subtermStep :: SubtermStep -> Maybe String
+ Hydra.Print.Paths: subtermStep :: SubtermStep -> String

Files

CHANGELOG.md view
@@ -15,6 +15,168 @@  --- +## [0.17.6] - 2026-08-30++Point release on the 0.17.x line, and the last backward-incompatible batch before the 1.0 surface+freeze. Five kernel-surface changes land together as the "0.17 breaking batch":+`null` becomes `isEmpty`, `read*`/`show*` become `parse*`/`print*`, `TypeScheme.constraints` and+`TypeVariableConstraints.classes` change shape, and the constructor primitives are finalized.+Alongside them, a genuine soundness gap in type inference is fixed — class constraints now propagate+through function-domain positions — and the cold-seed path is rebuilt on the Java host so that+breaking core-type changes are no longer structurally impossible to bootstrap.++**Backward-incompatible.** All five surface changes below alter the published kernel. Code written+against 0.17.5 must be updated:++- **[#682]** `hydra.lib.{lists,sets,maps,strings}.null` -> `.isEmpty`.+- **[#691]** the `read*`/`show*` family -> `parse*`/`print*`.+- **[#683]** `TypeScheme.constraints`: `optional<map>` -> plain `map`.+- **[#685]** `TypeVariableConstraints.classes`: `list` -> `set`.+- **[#687]** constructor primitives finalized: `lists.pure` is removed; `optionals.given`,+  `eithers.left`/`right` and `pairs.pair` are added.++[#682]: https://github.com/CategoricalData/hydra/issues/682+[#683]: https://github.com/CategoricalData/hydra/issues/683+[#685]: https://github.com/CategoricalData/hydra/issues/685+[#687]: https://github.com/CategoricalData/hydra/issues/687+[#691]: https://github.com/CategoricalData/hydra/issues/691++### Highlights++- **Class constraints propagate through contravariant positions**+  ([#702](https://github.com/CategoricalData/hydra/issues/702)): inference silently dropped a class+  constraint when the constrained type variable was bound through the **domain** (input) position of a+  higher-order function argument, while transferring it correctly in output positions — a real soundness+  gap in the type checker. It had been papered over twice by freezing `encodeMap`/`encodeSet` to+  monomorphic `Int`. Both freezes and the [#554](https://github.com/CategoricalData/hydra/issues/554)+  `toPrimitive` stopgap are now removed, the definitions re-polymorphized, and a domain-position+  regression test added. A `sets.filter` overlay lands across Java, Python, Scala, TypeScript and the+  Lisp dialects as its first consumer.+- **Cold-seed rebuilt on the Java host**+  ([#703](https://github.com/CategoricalData/hydra/issues/703)): CI's cold-seed steps compiled HEAD's+  kernel `Types` source against the *published* Hackage `hydra-kernel`, which is sound only for additive+  changes and structurally impossible for any breaking core-type-shape change — the root of a recurring+  red-CI class (#500, #608, #617, #417, #683). The Haskell cold-seeder (`ColdSeedMain`, `typesmods/`,+  Check-2) is deleted and replaced by a data-driven Java-host schema-walking seed+  (`seed-dist-haskell.sh`), which decodes `dist/json` and emits Haskell text without ever linking+  HEAD types against a published kernel.+- **`hydra.paths` completed** ([#716](https://github.com/CategoricalData/hydra/issues/716)):+  the step unions are realigned with the `hydra.core` term and type grammars — missing variants+  added (`annotatedAnnotation`, `eitherLeft`/`eitherRight`, `effect`), undirected steps given a+  direction, and variants named after retired constructors renamed. `hydra.print.paths` is rewritten+  as serialization-only (printers, parsers and a round-trip law), and the graph view moves to a new+  `hydra.shredding` module (`shredGraph`/`shredTerm`/`shredSchema`), which the Graphviz coder now+  consumes.+- **`hydra.lib.ordering` is genuinely structural on every host**+  ([#718](https://github.com/CategoricalData/hydra/issues/718)): the Java, Python and Scala overlay+  implementations fell back to comparing *printed strings* for non-literal and mixed-variant terms,+  contradicting the normative `ordering-and-equality.md` (records field-by-field in declaration+  order, unions by declared-variant order then payload, wrappers by wrapped value, decimals by+  numeric value then scale — with no print-based fallback anywhere). All three are now structural;+  Java delegates to the generated `compareTo`.+- **Bash driver-layer audit** ([#714](https://github.com/CategoricalData/hydra/issues/714)):+  a prerequisite to the remaining #416 promotion. Six dead build scripts superseded by+  `transform-json-to-target.sh` are deleted, and the #608 oil-and-water and #540 header-idempotency+  regression harnesses are wired into `test-regressions.sh`.++- **Backward-compatibility and deprecation policy**+  ([#676](https://github.com/CategoricalData/hydra/issues/676)): adds the normative spec chapter defining+  what "compatible" means after 1.0 — the additivity calculus, the deprecation/rename mechanism, and+  enforcement. `LifecycleInfo.deprecatedSince` moves from defined-but-unused to populated on **32**+  kernel primitives slated for 0.18 deprecation, via a new `deprecatedSince` DSL helper.+- **Effect-sequencing contract specified and tested**+  ([#675](https://github.com/CategoricalData/hydra/issues/675)): `hydra.lib.effects` carries a sequencing+  contract — effects composed in a specified order, exactly once each, with `bind`'s continuation deferred+  until the prior effect has run. On the lazy Haskell host this falls out of the evaluation model; on the+  eight eager hosts it depended entirely on each hand-written interpreter. The obligations are now written+  into `effects.md` and backed by ordering-observation tests for `bind`/`foldList`/`mapList`/`mapOptional`.+- **Non-GC memory-discipline investigation**+  ([#678](https://github.com/CategoricalData/hydra/issues/678)): Hydra's data model says nothing about+  allocation, freeing, or ownership, which is what gates Swift, Rust, C++ and C as runtime hosts. This+  investigation delivers per-language verdicts plus leak-free proof-of-concept implementations — Rust+  (`Box` structural ownership), C++ (`unique_ptr` + arena) and C (arena), all ASan/LSan-clean on+  construct-and-drop of a recursive `Term` — and an airtight analysis of Swift's class-forcing requirement.+- **Build system promotion continues** ([#416](https://github.com/CategoricalData/hydra/issues/416)):+  adds `hydra.build.Registry`, which models per-language build identity as data (name / coder package /+  family) with per-script scope lists. `syncMatrix` and `langExpansion` are rewired onto it, and the+  hardcoded language lists in the test and bench scripts are retired in favour of a generated+  `languages.json`. Later in the cycle: `publishsets.reverseDepClosure` and+  `publishsets.requiresCoders` promote reverse-dependency propagation and per-package coder-loading+  into data, an `expected-libraries.json` artifact lets the Common Lisp and Emacs Lisp harnesses+  fail fast on a missing `hydra.lib`, and a host-independent `apply-assembly-plan.sh` executor+  (with a conformance test) takes over the Java `assemble-distribution` Step 0.+- **Serialization specification chapter**+  ([#674](https://github.com/CategoricalData/hydra/issues/674)): documents serializability, the+  encode/decode contract, and the round-trip law; `isSerializable` now forbids `void`+  ([#690](https://github.com/CategoricalData/hydra/issues/690)), and `hydra.lib.functions.absurd` is added+  as the void eliminator ([#684](https://github.com/CategoricalData/hydra/issues/684)).++### Bug fixes++- **Hoisting silently produced terms with free variables**+  ([#717](https://github.com/CategoricalData/hydra/issues/717)):+  `augmentBindingsWithNewFreeVars` returned a binding *unchanged* when a captured variable had no+  type in the context, yielding a top-level binding with free variables — a term valid before+  hoisting and invalid after, produced with no error. It is now total and fails loudly, per the+  kernel's fail-immediately rule.+- **TypeScript `div`/`mod` used truncating semantics**+  ([#677](https://github.com/CategoricalData/hydra/issues/677)): corrected to floor/Knuth division via+  shared bigint helpers, with an `Optional` codomain; the dead `maybeDiv`/`maybeMod` are deleted and an+  emitted-path test added.+- **Overlay lag behind the `null` -> `isEmpty` rename**+  ([#682](https://github.com/CategoricalData/hydra/issues/682)): the Java, Python, Scala, TypeScript and+  Lisp overlays each kept a stale spelling (`isEmpty_`, a half-renamed Python `null` impl, and Lisp+  camelCase where the coder emits snake_case), breaking generation until reconciled.+- **`check-haskell-def-completeness` could not resolve qualified assembly references**+  ([#683](https://github.com/CategoricalData/hydra/issues/683)), surfaced once the #703 cold-clone path+  began reaching the check.+- **Void-typed definitions leaked into DSL-ref generation**+  ([#684](https://github.com/CategoricalData/hydra/issues/684)): `absurd` and friends are now excluded+  across all hosts.+- **Scheme bootstrap loader gaps** ([#641](https://github.com/CategoricalData/hydra/issues/641)):+  missing `functions.scm`/`ordering.scm` in the native-lib load list, missing defaults in the def-module+  load list, and a guile-only import allowlist.+- **Bootstrap diff detail was swallowed** ([#671](https://github.com/CategoricalData/hydra/issues/671)):+  now persisted to `<run>/<path>.diff`, with `compare_output`'s return value no longer discarded.+  Separately, `compare_output` mis-derived the `src/main` vs `src/test` root per file+  ([#706](https://github.com/CategoricalData/hydra/issues/706)).+- **Nested duplicate output path** ([#664](https://github.com/CategoricalData/hydra/issues/664)) from+  `hydra-kernel` being hardcoded into `defaultOutput`.+- **Bootstrap codegen exceptions hid their stack traces**+  ([#707](https://github.com/CategoricalData/hydra/issues/707)) in `bootstrap.ts`.++### Release tooling++- `bin/check-release-env.sh` ([#704](https://github.com/CategoricalData/hydra/issues/704)) adds a+  publish-time toolchain preflight, after JDK- and twine-version problems cost real time at 0.17.5.+- The TypeScript head's node floor is lowered to `^18.0.0 || >=20.0.0`, the true vitest constraint+  ([#708](https://github.com/CategoricalData/hydra/issues/708)).+- Hydra does not create GitHub Releases; the detached `.asc` signature stays in `release-artifacts/`+  until [#441](https://github.com/CategoricalData/hydra/issues/441)+  ([#508](https://github.com/CategoricalData/hydra/issues/508)).++### Known issues++- The `hostOverrides` shim is pinned to `{java: local, python: local}` for the duration of the breaking+  batch, since the new kernel surface is by definition absent from published 0.17.5. It must be retired+  once 0.17.6 is visible in Maven Central and PyPI+  ([#508](https://github.com/CategoricalData/hydra/issues/508)).+- **`hydra-ext` does not ship to Maven Central for Java**, as in 0.17.4 and 0.17.5: the Java coder's+  visitor-pattern inner interface still collides with an enclosing type named `Visitor`+  ([#643](https://github.com/CategoricalData/hydra/issues/643)), so the package does not compile for+  that target. It publishes to Hackage and PyPI as usual.+- The breaking batch leaves three deliberate 0.18 tails, each separately tracked:+  `effects.pure` is retained provisionally pending a name decision+  ([#688](https://github.com/CategoricalData/hydra/issues/688)); the `printable` type class that would+  promote the print/parse convention into enforced dispatch awaits+  [#497](https://github.com/CategoricalData/hydra/issues/497); and the literal conversion lattice is+  gated on [#129](https://github.com/CategoricalData/hydra/issues/129) via+  [#689](https://github.com/CategoricalData/hydra/issues/689). Anticipated `TypeClassConstraint`+  variants remain open as [#686](https://github.com/CategoricalData/hydra/issues/686) — the `set`+  element type must stay orderable as variants are added.++---+ ## [0.17.5] - 2026-08-19  Point release on the 0.17.x line. Two language-surface changes lead: sum-type eliminators unify on
hydra-kernel.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.38.1.+-- This file has been generated from package.yaml by hpack version 0.39.1. -- -- see: https://github.com/sol/hpack  name:           hydra-kernel-version:        0.17.5+version:        0.17.6 synopsis:       The Hydra kernel: core types, terms, inference, and DSL runtime description:    Hydra is an implementation of the LambdaGraph data model, which takes advantage of an isomorphism between labeled hypergraphs and typed lambda calculus: in Hydra, "graphs are programs, and programs are graphs". This package is the Hydra kernel: the core type and term model, type inference, the term rewriting and reduction engine, the primitive library, and the DSL runtime — the code that must be present in every Hydra implementation. The convenient entry point is the Hydra.Kernel module, which re-exports the kernel's collision-free surface. category:       Data@@ -309,6 +309,7 @@       Hydra.Scoping       Hydra.Serialization       Hydra.Settings+      Hydra.Shredding       Hydra.Sorting       Hydra.Strip       Hydra.Substitution
src/main/haskell/Hydra/Adapt.hs view
@@ -64,6 +64,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S @@ -86,14 +87,14 @@           prims0 = Graph.graphPrimitives graph0           schemaTypes0 = Graph.graphSchemaTypes graph0           schemaBindings = Environment.typesToDefinitions (Maps.map (\ts -> Scoping.typeSchemeToFType ts) schemaTypes0)-      in (Eithers.bind (Logic.ifElse (Maps.null schemaTypes0) (Right Maps.empty) (Eithers.bind (Eithers.bimap (\e -> Errors.ErrorDecoding e) (\x -> x) (Environment.graphAsTypes graph0 schemaBindings)) (\tmap0 -> Eithers.bind (adaptGraphSchema constraints litmap tmap0) (\tmap1 -> Right (Maps.map (\t -> Resolution.typeToTypeScheme t) tmap1))))) (\schemaResult ->+      in (Eithers.bind (Logic.ifElse (Maps.isEmpty schemaTypes0) (Right Maps.empty) (Eithers.bind (Eithers.bimap (\e -> Errors.ErrorDecoding e) (\x -> x) (Environment.graphAsTypes graph0 schemaBindings)) (\tmap0 -> Eithers.bind (adaptGraphSchema constraints litmap tmap0) (\tmap1 -> Right (Maps.map (\t -> Resolution.typeToTypeScheme t) tmap1))))) (\schemaResult ->         let adaptedSchemaTypes = schemaResult             adaptBinding =                     \el ->                       let transformed = transformBinding graph0 el                           wrapped =                                   Core.TermLet (Core.Let {-                                    Core.letBindings = (Lists.pure transformed),+                                    Core.letBindings = (Lists.singleton transformed),                                     Core.letBody = Core.TermUnit})                       in (Eithers.bind (adaptTerm constraints litmap cx graph0 wrapped) (\adapted -> Rewriting.rewriteTermM (adaptLambdaDomains constraints litmap) adapted))         in (Eithers.bind (Eithers.mapList adaptBinding els0) (\adaptedTerms ->@@ -180,7 +181,7 @@         Core.LiteralTypeInteger v1 -> Core.LiteralInteger (Literals.bigintToIntegerValue v1 (Logic.ifElse v0 1 0))       Core.LiteralDecimal v0 -> case lt of         Core.LiteralTypeFloat _ -> Core.LiteralFloat (Core.FloatValueFloat64 (LibLiterals.decimalToFloat64 v0))-        Core.LiteralTypeString -> Core.LiteralString (LibLiterals.showDecimal v0)+        Core.LiteralTypeString -> Core.LiteralString (LibLiterals.printDecimal v0)       Core.LiteralFloat v0 -> case lt of         Core.LiteralTypeFloat v1 -> Core.LiteralFloat (case v1 of           Core.FloatTypeFloat32 -> Core.FloatValueFloat32 (case v0 of@@ -397,9 +398,9 @@                   \debugLabel -> \bindings ->                     let untypedBindings =                             Lists.map qualifyUntyped (Lists.filter (\b -> Logic.not (Optionals.isGiven (Core.bindingTypeScheme b))) bindings)-                    in (Logic.ifElse (Lists.null untypedBindings) (Right bindings) (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat [+                    in (Logic.ifElse (Lists.isEmpty untypedBindings) (Right bindings) (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat [                       "Found ",-                      (LibLiterals.showInt32 (Lists.length untypedBindings)),+                      (LibLiterals.printInt32 (Lists.length untypedBindings)),                       " untyped binding(s) (",                       debugLabel,                       "); each must carry a type scheme at this stage. ",@@ -734,7 +735,7 @@                   Packaging.typeDefinitionBody = Core.TypeScheme {                     Core.typeSchemeVariables = [],                     Core.typeSchemeBody = (Pairs.second pair),-                    Core.typeSchemeConstraints = Nothing}}+                    Core.typeSchemeConstraints = Maps.empty}}         in (Right (           tmap1,           (Lists.map (\names -> Lists.map toDef (Optionals.mapOptional (\n -> Optionals.map (\t -> (n, t)) (Maps.lookup n tmap1)) names)) nameLists))))))
src/main/haskell/Hydra/Analysis.hs view
@@ -57,6 +57,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Set as S  -- | Add names to existing module names mapping@@ -315,7 +316,7 @@                     Core.bindingTypeScheme = (Just (Core.TypeScheme {                       Core.typeSchemeVariables = [],                       Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Type")),-                      Core.typeSchemeConstraints = Nothing}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))+                      Core.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))                 Packaging.DefinitionTerm v0 -> Just (Core.Binding {                   Core.bindingName = (Packaging.termDefinitionName v0),                   Core.bindingTerm = (Packaging.termDefinitionBody v0),
src/main/haskell/Hydra/Annotations.hs view
@@ -51,6 +51,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S @@ -95,7 +96,7 @@ -- | Get description from annotations map (Either version) getDescription :: t0 -> Graph.Graph -> M.Map Core.Name Core.Term -> Either Errors.Error (Maybe String) getDescription cx graph anns =-    Optionals.match (Maps.lookup (Core.Name "description") anns) (Right Nothing) (\term -> Eithers.map Optionals.pure (ExtractCore.string graph term))+    Optionals.match (Maps.lookup (Core.Name "description") anns) (Right Nothing) (\term -> Eithers.map Optionals.given (ExtractCore.string graph term))  -- | Get a term annotation getTermAnnotation :: Core.Name -> Core.Term -> Maybe Core.Term@@ -115,7 +116,7 @@ -- | Get type from annotations getType :: Graph.Graph -> M.Map Core.Name Core.Term -> Either Errors.DecodingError (Maybe Core.Type) getType graph anns =-    Optionals.match (Maps.lookup Constants.keyType anns) (Right Nothing) (\dat -> Eithers.map Optionals.pure (DecodeCore.type_ graph dat))+    Optionals.match (Maps.lookup Constants.keyType anns) (Right Nothing) (\dat -> Eithers.map Optionals.given (DecodeCore.type_ graph dat))  -- | Get a type annotation getTypeAnnotation :: Core.Name -> Core.Type -> Maybe Core.Term@@ -149,7 +150,7 @@       in (Optionals.match (Core.bindingTypeScheme el) False (\ts -> Logic.and (Equality.equal ts (Core.TypeScheme {         Core.typeSchemeVariables = [],         Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Type")),-        Core.typeSchemeConstraints = Nothing})) (Logic.not isFlaggedAsFirstClassType)))+        Core.typeSchemeConstraints = Maps.empty})) (Logic.not isFlaggedAsFirstClassType)))  -- | Normalize term annotations normalizeTermAnnotations :: Core.Term -> Core.Term@@ -157,7 +158,7 @@        let anns = termAnnotationInternal term           stripped = Strip.deannotateTerm term-      in (Logic.ifElse (Maps.null anns) stripped (Core.TermAnnotated (Core.AnnotatedTerm {+      in (Logic.ifElse (Maps.isEmpty anns) stripped (Core.TermAnnotated (Core.AnnotatedTerm {         Core.annotatedTermBody = stripped,         Core.annotatedTermAnnotation = (wrapAnnotationMap anns)}))) @@ -167,7 +168,7 @@        let anns = typeAnnotationInternal typ           stripped = Strip.deannotateType typ-      in (Logic.ifElse (Maps.null anns) stripped (Core.TypeAnnotated (Core.AnnotatedType {+      in (Logic.ifElse (Maps.isEmpty anns) stripped (Core.TypeAnnotated (Core.AnnotatedType {         Core.annotatedTypeBody = stripped,         Core.annotatedTypeAnnotation = (wrapAnnotationMap anns)}))) @@ -186,7 +187,7 @@        let term_ = Strip.deannotateTerm term           anns = setAnnotation key val (termAnnotationInternal term)-      in (Logic.ifElse (Maps.null anns) term_ (Core.TermAnnotated (Core.AnnotatedTerm {+      in (Logic.ifElse (Maps.isEmpty anns) term_ (Core.TermAnnotated (Core.AnnotatedTerm {         Core.annotatedTermBody = term_,         Core.annotatedTermAnnotation = (wrapAnnotationMap anns)}))) @@ -205,7 +206,7 @@        let typ_ = Strip.deannotateType typ           anns = setAnnotation key val (typeAnnotationInternal typ)-      in (Logic.ifElse (Maps.null anns) typ_ (Core.TypeAnnotated (Core.AnnotatedType {+      in (Logic.ifElse (Maps.isEmpty anns) typ_ (Core.TypeAnnotated (Core.AnnotatedType {         Core.annotatedTypeBody = typ_,         Core.annotatedTypeAnnotation = (wrapAnnotationMap anns)}))) @@ -218,7 +219,7 @@                 let name = Pairs.first nameClasses                     classes = Pairs.second nameClasses                 in (EncodeCore.name name, (Core.TermSet (Sets.fromList (Lists.map EncodeCore.name (Sets.toList classes)))))-          encoded = Logic.ifElse (Maps.null m) Nothing (Just (Core.TermMap (Maps.fromList (Lists.map encodePair (Maps.toList m)))))+          encoded = Logic.ifElse (Maps.isEmpty m) Nothing (Just (Core.TermMap (Maps.fromList (Lists.map encodePair (Maps.toList m)))))       in (setTermAnnotation Constants.keyClasses encoded term)  -- | Set type description
src/main/haskell/Hydra/Arity.hs view
@@ -37,6 +37,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Find the arity (expected number of arguments) of a primitive constant or function primitiveArity :: Graph.Primitive -> Int
src/main/haskell/Hydra/Ast.hs view
@@ -7,6 +7,7 @@ import qualified Hydra.Core as Core import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Operator associativity data Associativity =
src/main/haskell/Hydra/Checking.hs view
@@ -61,6 +61,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S @@ -88,7 +89,7 @@           Errors.unexpectedShapeErrorActual = (Strings.concat [             PrintCore.type_ t,             ". Trying to apply ",-            (Literals.showInt32 (Lists.length typeArgs)),+            (Literals.printInt32 (Lists.length typeArgs)),             " type args: ",             (Formatting.showList PrintCore.type_ typeArgs)])})))) (\schemaRes ->           let schemaType = Pairs.first schemaRes@@ -101,7 +102,7 @@           Errors.unexpectedShapeErrorActual = (Strings.concat [             PrintCore.type_ t,             ". Trying to apply ",-            (Literals.showInt32 (Lists.length typeArgs)),+            (Literals.printInt32 (Lists.length typeArgs)),             " type args: ",             (Formatting.showList PrintCore.type_ typeArgs),             ". Context has vars: {",@@ -121,7 +122,7 @@                                 \typ ->                                   let freevars = Variables.freeVariablesInType typ                                       badvars = Sets.difference (Sets.difference freevars vars) svars-                                  in (Logic.ifElse (Sets.null badvars) (Right ()) (Left (Errors.ErrorChecking (Checking.CheckingErrorUnboundTypeVariables (Checking.UnboundTypeVariablesError {+                                  in (Logic.ifElse (Sets.isEmpty badvars) (Right ()) (Left (Errors.ErrorChecking (Checking.CheckingErrorUnboundTypeVariables (Checking.UnboundTypeVariablesError {                                     Checking.unboundTypeVariablesErrorVariables = badvars,                                     Checking.unboundTypeVariablesErrorType = typ})))))                         checkOptional = \m -> Eithers.bind (Eithers.mapOptional check m) (\_ -> Right ())@@ -170,7 +171,7 @@           badPairs = Lists.filter (\p -> Sets.member (Pairs.first p) badVars) (Maps.toList s)           printPair =                   \p -> Strings.concat2 (Strings.concat2 (Core.unName (Pairs.first p)) " --> ") (PrintCore.type_ (Pairs.second p))-      in (Logic.ifElse (Sets.null badVars) (Right subst) (Left (Errors.ErrorChecking (Checking.CheckingErrorIncorrectUnification (Checking.IncorrectUnificationError {+      in (Logic.ifElse (Sets.isEmpty badVars) (Right subst) (Left (Errors.ErrorChecking (Checking.CheckingErrorIncorrectUnification (Checking.IncorrectUnificationError {         Checking.incorrectUnificationErrorSubstitution = subst})))))  -- | Check if a type contains any type variable from the current scope@@ -179,7 +180,7 @@        let vars = Graph.graphTypeVariables tx           freeVars = Variables.freeVariablesInTypeSimple t-      in (Logic.not (Sets.null (Sets.intersection vars freeVars)))+      in (Logic.not (Sets.isEmpty (Sets.intersection vars freeVars)))  -- | Normalize free type variables in a type to canonical names based on order of first occurrence. This allows comparing types that differ only in the naming of free type variables. Paper: inference.tex, 'Checking the witness' (effective equality). normalizeTypeFreeVars :: Core.Type -> Core.Type@@ -187,7 +188,7 @@        let collectVars =               \acc -> \t -> case t of-                Core.TypeVariable v0 -> Logic.ifElse (Maps.member v0 acc) acc (Maps.insert v0 (Core.Name (Strings.concat2 "_tv" (Literals.showInt32 (Maps.size acc)))) acc)+                Core.TypeVariable v0 -> Logic.ifElse (Maps.member v0 acc) acc (Maps.insert v0 (Core.Name (Strings.concat2 "_tv" (Literals.printInt32 (Maps.size acc)))) acc)                 _ -> acc           subst = Rewriting.foldOverType Coders.TraversalOrderPre collectVars Maps.empty typ       in (Variables.substituteTypeVariables subst typ)@@ -286,17 +287,17 @@                       in (Eithers.bind (typeOf cxA tx [] term) (\tResult ->                         let t = Pairs.first tResult                             cxB = Pairs.second tResult-                        in (Right (Lists.concat2 types (Lists.pure t), cxB)))))) (Right ([], cx2)) cterms+                        in (Right (Lists.concat2 types (Lists.singleton t), cxB)))))) (Right ([], cx2)) cterms         in (Eithers.bind foldResult (\foldR ->           let tcterms = Pairs.first foldR               cx3 = Pairs.second foldR               fcodsResult =                       Lists.foldl (\acc -> \t -> Eithers.bind acc (\accR ->                         let cods = Pairs.first accR-                        in (Eithers.bind (ExtractCore.functionType t) (\ft -> Right (Lists.concat2 cods (Lists.pure (Core.functionTypeCodomain ft)), cx3))))) (Right ([], cx3)) tcterms+                        in (Eithers.bind (ExtractCore.functionType t) (\ft -> Right (Lists.concat2 cods (Lists.singleton (Core.functionTypeCodomain ft)), cx3))))) (Right ([], cx3)) tcterms           in (Eithers.bind fcodsResult (\fcodsR ->             let fcods = Pairs.first fcodsR-                cods = Optionals.givens (Lists.cons tdflt (Lists.map Optionals.pure fcods))+                cods = Optionals.givens (Lists.cons tdflt (Lists.map Optionals.given fcods))             in (Eithers.bind (checkSameType cx3 tx "case branches" cods) (\cod -> Right (               Core.TypeFunction (Core.FunctionType {                 Core.functionTypeDomain = (Resolution.nominalApplication tname typeArgs),@@ -394,7 +395,7 @@           btypesResult =                   Lists.foldl (\acc -> \b -> Eithers.bind acc (\accR ->                     let types = Pairs.first accR-                    in (Eithers.bind (bindingType b) (\btype -> Right (Lists.concat2 types (Lists.pure btype), ()))))) (Right ([], ())) bs+                    in (Eithers.bind (bindingType b) (\btype -> Right (Lists.concat2 types (Lists.singleton btype), ()))))) (Right ([], ())) bs       in (Eithers.bind btypesResult (\btypesR ->         let btypes = Pairs.first btypesR             tx2 =@@ -422,7 +423,7 @@                 Checking.typeArityMismatchErrorExpectedArity = 1,                 Checking.typeArityMismatchErrorActualArity = (Lists.length typeArgs),                 Checking.typeArityMismatchErrorTypeArguments = typeArgs})))-      in (Logic.ifElse (Lists.null els) (Logic.ifElse (Equality.equal (Lists.length typeArgs) 1) (Optionals.match (Lists.head typeArgs) listArityErr (\ta0 -> Right (Core.TypeList ta0, cx))) listArityErr) (+      in (Logic.ifElse (Lists.isEmpty els) (Logic.ifElse (Equality.equal (Lists.length typeArgs) 1) (Optionals.match (Lists.head typeArgs) listArityErr (\ta0 -> Right (Core.TypeList ta0, cx))) listArityErr) (         let foldResult =                 Lists.foldl (\acc -> \term -> Eithers.bind acc (\accR ->                   let types = Pairs.first accR@@ -430,7 +431,7 @@                   in (Eithers.bind (typeOf cxA tx [] term) (\tResult ->                     let t = Pairs.first tResult                         cxB = Pairs.second tResult-                    in (Right (Lists.concat2 types (Lists.pure t), cxB)))))) (Right ([], cx)) els+                    in (Right (Lists.concat2 types (Lists.singleton t), cxB)))))) (Right ([], cx)) els         in (Eithers.bind foldResult (\foldR ->           let eltypes = Pairs.first foldR               cx2 = Pairs.second foldR@@ -455,7 +456,7 @@                 Checking.typeArityMismatchErrorExpectedArity = 2,                 Checking.typeArityMismatchErrorActualArity = (Lists.length typeArgs),                 Checking.typeArityMismatchErrorTypeArguments = typeArgs})))-      in (Logic.ifElse (Maps.null m) (Logic.ifElse (Equality.equal (Lists.length typeArgs) 2) (Optionals.match (Lists.uncons typeArgs) mapArityErr (\uc0 ->+      in (Logic.ifElse (Maps.isEmpty m) (Logic.ifElse (Equality.equal (Lists.length typeArgs) 2) (Optionals.match (Lists.uncons typeArgs) mapArityErr (\uc0 ->         let ta0 = Pairs.first uc0         in (Optionals.match (Lists.uncons (Pairs.second uc0)) mapArityErr (\uc1 ->           let ta1 = Pairs.first uc1@@ -472,7 +473,7 @@                       in (Eithers.bind (typeOf cxA tx [] (Pairs.first p)) (\tResult ->                         let t = Pairs.first tResult                             cxB = Pairs.second tResult-                        in (Right (Lists.concat2 types (Lists.pure t), cxB)))))) (Right ([], cx)) pairs+                        in (Right (Lists.concat2 types (Lists.singleton t), cxB)))))) (Right ([], cx)) pairs         in (Eithers.bind keyFoldResult (\keyFoldR ->           let keyTypes = Pairs.first keyFoldR               cx2 = Pairs.second keyFoldR@@ -484,7 +485,7 @@                       in (Eithers.bind (typeOf cxA tx [] (Pairs.second p)) (\tResult ->                         let t = Pairs.first tResult                             cxB = Pairs.second tResult-                        in (Right (Lists.concat2 types (Lists.pure t), cxB)))))) (Right ([], cx2)) pairs+                        in (Right (Lists.concat2 types (Lists.singleton t), cxB)))))) (Right ([], cx2)) pairs             in (Eithers.bind valFoldResult (\valFoldR ->               let valTypes = Pairs.first valFoldR                   cx3 = Pairs.second valFoldR@@ -588,7 +589,7 @@                     in (Eithers.bind (typeOf cxA tx [] term) (\tResult ->                       let t = Pairs.first tResult                           cxB = Pairs.second tResult-                      in (Right (Lists.concat2 types (Lists.pure t), cxB)))))) (Right ([], cx)) (Lists.map Core.fieldTerm fields)+                      in (Right (Lists.concat2 types (Lists.singleton t), cxB)))))) (Right ([], cx)) (Lists.map Core.fieldTerm fields)       in (Eithers.bind foldResult (\foldR ->         let cx2 = Pairs.second foldR         in (Right (Resolution.nominalApplication tname typeArgs, cx2))))@@ -603,7 +604,7 @@                 Checking.typeArityMismatchErrorExpectedArity = 1,                 Checking.typeArityMismatchErrorActualArity = (Lists.length typeArgs),                 Checking.typeArityMismatchErrorTypeArguments = typeArgs})))-      in (Logic.ifElse (Sets.null els) (Logic.ifElse (Equality.equal (Lists.length typeArgs) 1) (Optionals.match (Lists.head typeArgs) setArityErr (\ta0 -> Right (Core.TypeSet ta0, cx))) setArityErr) (+      in (Logic.ifElse (Sets.isEmpty els) (Logic.ifElse (Equality.equal (Lists.length typeArgs) 1) (Optionals.match (Lists.head typeArgs) setArityErr (\ta0 -> Right (Core.TypeSet ta0, cx))) setArityErr) (         let foldResult =                 Lists.foldl (\acc -> \term -> Eithers.bind acc (\accR ->                   let types = Pairs.first accR@@ -611,7 +612,7 @@                   in (Eithers.bind (typeOf cxA tx [] term) (\tResult ->                     let t = Pairs.first tResult                         cxB = Pairs.second tResult-                    in (Right (Lists.concat2 types (Lists.pure t), cxB)))))) (Right ([], cx)) (Sets.toList els)+                    in (Right (Lists.concat2 types (Lists.singleton t), cxB)))))) (Right ([], cx)) (Sets.toList els)         in (Eithers.bind foldResult (\foldR ->           let eltypes = Pairs.first foldR               cx2 = Pairs.second foldR@@ -682,7 +683,7 @@       let forScheme =               \ts ->                 let tResult =-                        Logic.ifElse (Lists.null typeArgs) (Resolution.instantiateType cx (Scoping.typeSchemeToFType ts)) (Scoping.typeSchemeToFType ts, cx)+                        Logic.ifElse (Lists.isEmpty typeArgs) (Resolution.instantiateType cx (Scoping.typeSchemeToFType ts)) (Scoping.typeSchemeToFType ts, cx)                     t = Pairs.first tResult                     cx2 = Pairs.second tResult                 in (Eithers.bind (applyTypeArgumentsToType cx2 tx typeArgs t) (\applied -> Right (applied, cx2)))@@ -711,7 +712,7 @@                   \t ->                     let allVars = Variables.freeVariablesInTypeSimple t                         schemaNames = Sets.fromList (Maps.keys types)-                    in (Logic.not (Sets.null (Sets.difference allVars schemaNames)))+                    in (Logic.not (Sets.isEmpty (Sets.difference allVars schemaNames)))           anyContainsFreeVar = Lists.foldl (\acc -> \t -> Logic.or acc (containsFreeVar t)) False tlist       in (Logic.ifElse anyContainsFreeVar True (Logic.ifElse (allEqual (Lists.map (\t -> normalizeTypeFreeVars t) tlist)) True (allEqual (Lists.map (\t -> normalizeTypeFreeVars (Strip.deannotateTypeRecursive (Dependencies.replaceTypedefs types t))) tlist)))) 
src/main/haskell/Hydra/Classes.hs view
@@ -38,6 +38,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Check whether a type is an instance of a constraint class, by the class's short name. classIsSatisfiedByType :: Core.Name -> Core.Type -> Bool
src/main/haskell/Hydra/Codegen.hs view
@@ -67,6 +67,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S @@ -146,7 +147,7 @@                         Core.bindingTypeScheme = (Just (Core.TypeScheme {                           Core.typeSchemeVariables = [],                           Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Type")),-                          Core.typeSchemeConstraints = Nothing}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))+                          Core.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))                     _ -> Nothing) (Packaging.moduleDefinitions m))) closureModules)           dataElements =                   Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of@@ -189,7 +190,7 @@           doHoistCaseStatements = Logic.not (Sets.member Coders.LanguageFeatureNestedCaseStatements features)           doHoistPolymorphicLetBindings = Logic.not (Sets.member Coders.LanguageFeatureNestedPolymorphicLetBindings features)           typeModulesToGenerate =-                  Lists.filter (\mod -> Logic.not (Lists.null (Optionals.givens (Lists.map (\d -> case d of+                  Lists.filter (\mod -> Logic.not (Lists.isEmpty (Optionals.givens (Lists.map (\d -> case d of                     Packaging.DefinitionType v0 -> Just ((\name -> \typ ->                       let schemaTerm = Core.TermVariable (Core.Name "hydra.core.Type")                           dataTerm =@@ -203,10 +204,10 @@                         Core.bindingTypeScheme = (Just (Core.TypeScheme {                           Core.typeSchemeVariables = [],                           Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Type")),-                          Core.typeSchemeConstraints = Nothing}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))+                          Core.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))                     _ -> Nothing) (Packaging.moduleDefinitions mod))))) modsToGenerate           termModulesToGenerate =-                  Lists.filter (\mod -> Logic.not (Lists.null (Optionals.givens (Lists.map (\d -> case d of+                  Lists.filter (\mod -> Logic.not (Lists.isEmpty (Optionals.givens (Lists.map (\d -> case d of                     Packaging.DefinitionTerm v0 -> Just (Core.Binding {                       Core.bindingName = (Packaging.termDefinitionName v0),                       Core.bindingTerm = (Packaging.termDefinitionBody v0),@@ -228,7 +229,7 @@                         Core.bindingTypeScheme = (Just (Core.TypeScheme {                           Core.typeSchemeVariables = [],                           Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Type")),-                          Core.typeSchemeConstraints = Nothing}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))+                          Core.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))                     _ -> Nothing) (Packaging.moduleDefinitions m))) closureMods)           dataElements =                   Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of@@ -240,7 +241,7 @@           schemaGraph = Lexical.elementsToGraph bsGraph Maps.empty schemaElements           schemaTypes2 = Eithers.either (\_ -> Maps.empty) (\_r -> _r) (Environment.schemaGraphToTypingEnvironment schemaGraph)           dataGraph = Lexical.elementsToGraph bsGraph schemaTypes2 dataElements-      in (Eithers.bind (Logic.ifElse (Lists.null typeModulesToGenerate) (Right []) (+      in (Eithers.bind (Logic.ifElse (Lists.isEmpty typeModulesToGenerate) (Right []) (         let nameLists =                 Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of                   Packaging.DefinitionType v0 -> Just (Packaging.typeDefinitionName v0)@@ -260,7 +261,7 @@           in (Eithers.map (\xs -> Lists.concat xs) (Eithers.mapList (\p ->             let mod = Pairs.first p                 defs = Pairs.second p-            in (Eithers.map (\m -> Maps.toList m) (printDefinitions mod (Lists.map (\d -> Packaging.DefinitionType d) defs) cx schemaGraphWithTypes))) (Lists.zip typeModulesToGenerate defLists))))))) (\schemaFiles -> Eithers.bind (Logic.ifElse (Lists.null termModulesToGenerate) (Right []) (+            in (Eithers.map (\m -> Maps.toList m) (printDefinitions mod (Lists.map (\d -> Packaging.DefinitionType d) defs) cx schemaGraphWithTypes))) (Lists.zip typeModulesToGenerate defLists))))))) (\schemaFiles -> Eithers.bind (Logic.ifElse (Lists.isEmpty termModulesToGenerate) (Right []) (         let namespaces = Lists.map (\m -> Packaging.moduleName m) termModulesToGenerate         in (Eithers.bind (Adapt.dataGraphToDefinitions constraints doInfer doExpand doHoistCaseStatements doHoistPolymorphicLetBindings dataElements dataGraph namespaces cx) (\dataResult ->           let g1 = Pairs.first dataResult@@ -322,7 +323,7 @@                           Core.bindingTypeScheme = (Just (Core.TypeScheme {                             Core.typeSchemeVariables = [],                             Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Type")),-                            Core.typeSchemeConstraints = Nothing}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))+                            Core.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))                       _ -> Nothing) (Packaging.moduleDefinitions m))) kernelModules)             typeBoundTerms = Maps.fromList (Lists.map (\b -> (Core.bindingName b, (Core.bindingTerm b))) schemaElements)             typeBoundTypes =@@ -424,7 +425,7 @@                   Scoping.typeSchemeToTermSignature (Core.TypeScheme {                     Core.typeSchemeVariables = [],                     Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.packaging.PrimitiveDefinition")),-                    Core.typeSchemeConstraints = Nothing})+                    Core.typeSchemeConstraints = Maps.empty})           origDefs = Packaging.moduleDefinitions m           hasPrim =                   Lists.foldl (\acc -> \d -> Logic.or acc (case d of@@ -490,7 +491,7 @@                     Packaging.termDefinitionSignature = (Just (Scoping.typeSchemeToTermSignature (Core.TypeScheme {                       Core.typeSchemeVariables = [],                       Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.packaging.Module")),-                      Core.typeSchemeConstraints = Nothing}))),+                      Core.typeSchemeConstraints = Maps.empty}))),                     Packaging.termDefinitionBody = (EncodePackaging.module_ m)})       in Packaging.Module {         Packaging.moduleName = sourceNs,@@ -527,7 +528,7 @@                         Core.bindingTypeScheme = (Just (Core.TypeScheme {                           Core.typeSchemeVariables = [],                           Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Type")),-                          Core.typeSchemeConstraints = Nothing}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))+                          Core.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))                     _ -> Nothing) (Packaging.moduleDefinitions m))) closureModules)           dataElements =                   Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of@@ -561,7 +562,7 @@ -- | Rebuild a module's term definitions using freshly inferred bindings refreshModule :: [Core.Binding] -> Packaging.Module -> Packaging.Module refreshModule inferredElements m =-    Logic.ifElse (Logic.not (Logic.not (Lists.null (Optionals.givens (Lists.map (\d -> case d of+    Logic.ifElse (Logic.not (Logic.not (Lists.isEmpty (Optionals.givens (Lists.map (\d -> case d of       Packaging.DefinitionTerm v0 -> Just (Core.Binding {         Core.bindingName = (Packaging.termDefinitionName v0),         Core.bindingTerm = (Packaging.termDefinitionBody v0),@@ -586,7 +587,7 @@       let initialDeps =               Sets.fromList (Lists.concat (Lists.map (\m -> Lists.filter (\dep -> Logic.not (Equality.equal dep (Packaging.moduleName m))) (getDeps m)) startMods))           go =-                  \pending -> \visited -> Logic.ifElse (Sets.null pending) visited (+                  \pending -> \visited -> Logic.ifElse (Sets.isEmpty pending) visited (                     let newVisited = Sets.union visited pending                         nextDeps =                                 Sets.fromList (Lists.concat (Lists.map (\nsv -> Optionals.match (Maps.lookup nsv nsMap) [] (\depMod -> getDeps depMod)) (Sets.toList pending)))
src/main/haskell/Hydra/Coders.hs view
@@ -12,6 +12,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S 
src/main/haskell/Hydra/Constants.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | The conventional field name used when normalizing a wrapped (newtype) value to a single-field record fieldNameValue :: String
src/main/haskell/Hydra/Core.hs view
@@ -6,6 +6,7 @@  import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.ByteString as B import qualified Data.Int as I import qualified Data.Map as M@@ -703,8 +704,8 @@     typeSchemeVariables :: [Name],     -- | The type expression     typeSchemeBody :: Type,-    -- | Optional constraints on type variables, including typeclass constraints. The map keys are type variable names.-    typeSchemeConstraints :: (Maybe (M.Map Name TypeVariableConstraints))}+    -- | Constraints on type variables, including typeclass constraints. The map keys are type variable names; an empty map means no constraints.+    typeSchemeConstraints :: (M.Map Name TypeVariableConstraints)}   deriving (Eq, Ord, Read, Show)  _TypeScheme = Name "hydra.core.TypeScheme"@@ -719,7 +720,7 @@ data TypeVariableConstraints =   TypeVariableConstraints {     -- | The typeclass constraints on this type variable-    typeVariableConstraintsClasses :: [TypeClassConstraint]}+    typeVariableConstraintsClasses :: (S.Set TypeClassConstraint)}   deriving (Eq, Ord, Read, Show)  _TypeVariableConstraints = Name "hydra.core.TypeVariableConstraints"
src/main/haskell/Hydra/Decode/Ast.hs view
@@ -19,6 +19,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.ast.Associativity associativity :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Ast.Associativity
src/main/haskell/Hydra/Decode/Coders.hs view
@@ -23,6 +23,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.coders.CaseConventions caseConventions :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Coders.CaseConventions
src/main/haskell/Hydra/Decode/Core.hs view
@@ -17,6 +17,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.core.AnnotatedTerm annotatedTerm :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Core.AnnotatedTerm@@ -599,7 +600,7 @@     Eithers.either (\err -> Left err) (\stripped -> case stripped of       Core.TermRecord v0 ->         let fieldMap = ExtractCore.toFieldMap v0-        in (Eithers.bind (ExtractCore.requireField "variables" (ExtractCore.decodeList name) fieldMap cx) (\field_variables -> Eithers.bind (ExtractCore.requireField "body" type_ fieldMap cx) (\field_body -> Eithers.bind (ExtractCore.requireField "constraints" (ExtractCore.decodeMaybe (ExtractCore.decodeMap name typeVariableConstraints)) fieldMap cx) (\field_constraints -> Right (Core.TypeScheme {+        in (Eithers.bind (ExtractCore.requireField "variables" (ExtractCore.decodeList name) fieldMap cx) (\field_variables -> Eithers.bind (ExtractCore.requireField "body" type_ fieldMap cx) (\field_body -> Eithers.bind (ExtractCore.requireField "constraints" (ExtractCore.decodeMap name typeVariableConstraints) fieldMap cx) (\field_constraints -> Right (Core.TypeScheme {           Core.typeSchemeVariables = field_variables,           Core.typeSchemeBody = field_body,           Core.typeSchemeConstraints = field_constraints})))))@@ -611,7 +612,7 @@     Eithers.either (\err -> Left err) (\stripped -> case stripped of       Core.TermRecord v0 ->         let fieldMap = ExtractCore.toFieldMap v0-        in (Eithers.bind (ExtractCore.requireField "classes" (ExtractCore.decodeList typeClassConstraint) fieldMap cx) (\field_classes -> Right (Core.TypeVariableConstraints {+        in (Eithers.bind (ExtractCore.requireField "classes" (ExtractCore.decodeSet typeClassConstraint) fieldMap cx) (\field_classes -> Right (Core.TypeVariableConstraints {           Core.typeVariableConstraintsClasses = field_classes})))       _ -> Left (Errors.DecodingError "expected a record of type hydra.core.TypeVariableConstraints")) (ExtractCore.stripWithDecodingError cx raw) 
src/main/haskell/Hydra/Decode/Docs.hs view
@@ -19,6 +19,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.docs.DocSegment docSegment :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Docs.DocSegment
src/main/haskell/Hydra/Decode/Error/Checking.hs view
@@ -22,6 +22,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.error.checking.CheckingError checkingError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Checking.CheckingError
src/main/haskell/Hydra/Decode/Error/Core.hs view
@@ -21,6 +21,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.error.core.ConstantConditionError constantConditionError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorCore.ConstantConditionError
src/main/haskell/Hydra/Decode/Error/File.hs view
@@ -19,6 +19,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.error.file.FileError fileError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorFile.FileError
src/main/haskell/Hydra/Decode/Error/Packaging.hs view
@@ -21,6 +21,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.error.packaging.ConflictingModuleNameError conflictingModuleNameError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError ErrorPackaging.ConflictingModuleNameError
src/main/haskell/Hydra/Decode/Error/System.hs view
@@ -19,6 +19,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.error.system.SystemError systemError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError System.SystemError
src/main/haskell/Hydra/Decode/Errors.hs view
@@ -23,6 +23,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.errors.DecodingError decodingError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Errors.DecodingError
src/main/haskell/Hydra/Decode/File.hs view
@@ -20,6 +20,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.file.FileExtension fileExtension :: Graph.Graph -> Core.Term -> Either Errors.DecodingError File.FileExtension
src/main/haskell/Hydra/Decode/Json/Model.hs view
@@ -19,6 +19,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.json.model.Value value :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Model.Value
src/main/haskell/Hydra/Decode/Packaging.hs view
@@ -20,6 +20,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.packaging.Definition definition :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Packaging.Definition
src/main/haskell/Hydra/Decode/Parsing.hs view
@@ -19,6 +19,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.parsing.ParseError parseError :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Parsing.ParseError
src/main/haskell/Hydra/Decode/Paths.hs view
@@ -19,17 +19,28 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void +-- | Decoder for hydra.paths.SubtermAttribute+subtermAttribute :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.SubtermAttribute+subtermAttribute cx raw =+    Eithers.either (\err -> Left err) (\stripped -> case stripped of+      Core.TermRecord v0 ->+        let fieldMap = ExtractCore.toFieldMap v0+        in (Eithers.bind (ExtractCore.requireField "path" subtermPath fieldMap cx) (\field_path -> Eithers.bind (ExtractCore.requireField "target" termAttribute fieldMap cx) (\field_target -> Right (Paths.SubtermAttribute {+          Paths.subtermAttributePath = field_path,+          Paths.subtermAttributeTarget = field_target}))))+      _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.SubtermAttribute")) (ExtractCore.stripWithDecodingError cx raw)+ -- | Decoder for hydra.paths.SubtermEdge subtermEdge :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.SubtermEdge subtermEdge cx raw =     Eithers.either (\err -> Left err) (\stripped -> case stripped of       Core.TermRecord v0 ->         let fieldMap = ExtractCore.toFieldMap v0-        in (Eithers.bind (ExtractCore.requireField "source" subtermNode fieldMap cx) (\field_source -> Eithers.bind (ExtractCore.requireField "path" subtermPath fieldMap cx) (\field_path -> Eithers.bind (ExtractCore.requireField "target" subtermNode fieldMap cx) (\field_target -> Right (Paths.SubtermEdge {-          Paths.subtermEdgeSource = field_source,+        in (Eithers.bind (ExtractCore.requireField "path" subtermPath fieldMap cx) (\field_path -> Eithers.bind (ExtractCore.requireField "target" DecodeCore.name fieldMap cx) (\field_target -> Right (Paths.SubtermEdge {           Paths.subtermEdgePath = field_path,-          Paths.subtermEdgeTarget = field_target})))))+          Paths.subtermEdgeTarget = field_target}))))       _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.SubtermEdge")) (ExtractCore.stripWithDecodingError cx raw)  -- | Decoder for hydra.paths.SubtermGraph@@ -38,29 +49,39 @@     Eithers.either (\err -> Left err) (\stripped -> case stripped of       Core.TermRecord v0 ->         let fieldMap = ExtractCore.toFieldMap v0-        in (Eithers.bind (ExtractCore.requireField "nodes" (ExtractCore.decodeList subtermNode) fieldMap cx) (\field_nodes -> Eithers.bind (ExtractCore.requireField "edges" (ExtractCore.decodeList subtermEdge) fieldMap cx) (\field_edges -> Right (Paths.SubtermGraph {-          Paths.subtermGraphNodes = field_nodes,-          Paths.subtermGraphEdges = field_edges}))))+        in (Eithers.bind (ExtractCore.requireField "nodes" (ExtractCore.decodeList subtermNode) fieldMap cx) (\field_nodes -> Right (Paths.SubtermGraph {+          Paths.subtermGraphNodes = field_nodes})))       _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.SubtermGraph")) (ExtractCore.stripWithDecodingError cx raw) +-- | Decoder for hydra.paths.SubtermLink+subtermLink :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.SubtermLink+subtermLink cx raw =+    Eithers.either (\err -> Left err) (\stripped -> case stripped of+      Core.TermInject v0 ->+        let field = Core.injectionField v0+            fname = Core.fieldName field+            fterm = Core.fieldTerm field+            variantMap =+                    Maps.fromList [+                      (Core.Name "edge", (\input -> Eithers.map (\t -> Paths.SubtermLinkEdge t) (subtermEdge cx input))),+                      (Core.Name "property", (\input -> Eithers.map (\t -> Paths.SubtermLinkProperty t) (subtermProperty cx input))),+                      (Core.Name "attribute", (\input -> Eithers.map (\t -> Paths.SubtermLinkAttribute t) (subtermAttribute cx input)))]+        in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+          "no such field ",+          (Core.unName fname),+          " in union"]))) (\f -> f fterm))+      _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)+ -- | Decoder for hydra.paths.SubtermNode subtermNode :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.SubtermNode subtermNode cx raw =     Eithers.either (\err -> Left err) (\stripped -> case stripped of       Core.TermRecord v0 ->         let fieldMap = ExtractCore.toFieldMap v0-        in (Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "label" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of-          Core.TermLiteral v1 -> case v1 of-            Core.LiteralString v2 -> Right v2-            _ -> Left (Errors.DecodingError "expected string literal")-          _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_label -> Eithers.bind (ExtractCore.requireField "id" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of-          Core.TermLiteral v1 -> case v1 of-            Core.LiteralString v2 -> Right v2-            _ -> Left (Errors.DecodingError "expected string literal")-          _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_id -> Right (Paths.SubtermNode {+        in (Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "type" DecodeCore.typeScheme fieldMap cx) (\field_type -> Eithers.bind (ExtractCore.requireField "links" (ExtractCore.decodeList subtermLink) fieldMap cx) (\field_links -> Right (Paths.SubtermNode {           Paths.subtermNodeName = field_name,-          Paths.subtermNodeLabel = field_label,-          Paths.subtermNodeId = field_id})))))+          Paths.subtermNodeType = field_type,+          Paths.subtermNodeLinks = field_links})))))       _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.SubtermNode")) (ExtractCore.stripWithDecodingError cx raw)  -- | Decoder for hydra.paths.SubtermPath@@ -70,6 +91,17 @@       Core.TermWrap v0 -> Eithers.map (\b -> Paths.SubtermPath b) (ExtractCore.decodeList subtermStep cx (Core.wrappedTermBody v0))       _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw) +-- | Decoder for hydra.paths.SubtermProperty+subtermProperty :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.SubtermProperty+subtermProperty cx raw =+    Eithers.either (\err -> Left err) (\stripped -> case stripped of+      Core.TermRecord v0 ->+        let fieldMap = ExtractCore.toFieldMap v0+        in (Eithers.bind (ExtractCore.requireField "path" subtermPath fieldMap cx) (\field_path -> Eithers.bind (ExtractCore.requireField "target" DecodeCore.term fieldMap cx) (\field_target -> Right (Paths.SubtermProperty {+          Paths.subtermPropertyPath = field_path,+          Paths.subtermPropertyTarget = field_target}))))+      _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.SubtermProperty")) (ExtractCore.stripWithDecodingError cx raw)+ -- | Decoder for hydra.paths.SubtermStep subtermStep :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.SubtermStep subtermStep cx raw =@@ -81,23 +113,27 @@             variantMap =                     Maps.fromList [                       (+                        Core.Name "annotatedAnnotation",+                        (\input -> Eithers.map (\t -> Paths.SubtermStepAnnotatedAnnotation) (ExtractCore.decodeUnit cx input))),+                      (                         Core.Name "annotatedBody",                         (\input -> Eithers.map (\t -> Paths.SubtermStepAnnotatedBody) (ExtractCore.decodeUnit cx input))),                       (-                        Core.Name "applicationFunction",-                        (\input -> Eithers.map (\t -> Paths.SubtermStepApplicationFunction) (ExtractCore.decodeUnit cx input))),-                      (                         Core.Name "applicationArgument",                         (\input -> Eithers.map (\t -> Paths.SubtermStepApplicationArgument) (ExtractCore.decodeUnit cx input))),-                      (Core.Name "lambdaBody", (\input -> Eithers.map (\t -> Paths.SubtermStepLambdaBody) (ExtractCore.decodeUnit cx input))),                       (-                        Core.Name "unionCasesDefault",-                        (\input -> Eithers.map (\t -> Paths.SubtermStepUnionCasesDefault) (ExtractCore.decodeUnit cx input))),+                        Core.Name "applicationFunction",+                        (\input -> Eithers.map (\t -> Paths.SubtermStepApplicationFunction) (ExtractCore.decodeUnit cx input))),+                      (Core.Name "casesCase", (\input -> Eithers.map (\t -> Paths.SubtermStepCasesCase t) (DecodeCore.name cx input))),                       (-                        Core.Name "unionCasesBranch",-                        (\input -> Eithers.map (\t -> Paths.SubtermStepUnionCasesBranch t) (DecodeCore.name cx input))),-                      (Core.Name "letBody", (\input -> Eithers.map (\t -> Paths.SubtermStepLetBody) (ExtractCore.decodeUnit cx input))),+                        Core.Name "casesDefault",+                        (\input -> Eithers.map (\t -> Paths.SubtermStepCasesDefault) (ExtractCore.decodeUnit cx input))),+                      (Core.Name "eitherLeft", (\input -> Eithers.map (\t -> Paths.SubtermStepEitherLeft) (ExtractCore.decodeUnit cx input))),+                      (Core.Name "eitherRight", (\input -> Eithers.map (\t -> Paths.SubtermStepEitherRight) (ExtractCore.decodeUnit cx input))),+                      (Core.Name "injectField", (\input -> Eithers.map (\t -> Paths.SubtermStepInjectField t) (DecodeCore.name cx input))),+                      (Core.Name "lambdaBody", (\input -> Eithers.map (\t -> Paths.SubtermStepLambdaBody) (ExtractCore.decodeUnit cx input))),                       (Core.Name "letBinding", (\input -> Eithers.map (\t -> Paths.SubtermStepLetBinding t) (DecodeCore.name cx input))),+                      (Core.Name "letBody", (\input -> Eithers.map (\t -> Paths.SubtermStepLetBody) (ExtractCore.decodeUnit cx input))),                       (                         Core.Name "listElement",                         (\input -> Eithers.map (\t -> Paths.SubtermStepListElement t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of@@ -126,17 +162,10 @@                             _ -> Left (Errors.DecodingError "expected int32 literal")                           _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),                       (-                        Core.Name "optionalTerm",-                        (\input -> Eithers.map (\t -> Paths.SubtermStepOptionalTerm) (ExtractCore.decodeUnit cx input))),-                      (-                        Core.Name "productTerm",-                        (\input -> Eithers.map (\t -> Paths.SubtermStepProductTerm t) (Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of-                          Core.TermLiteral v1 -> case v1 of-                            Core.LiteralInteger v2 -> case v2 of-                              Core.IntegerValueInt32 v3 -> Right v3-                              _ -> Left (Errors.DecodingError "expected int32 value")-                            _ -> Left (Errors.DecodingError "expected int32 literal")-                          _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),+                        Core.Name "optionalGiven",+                        (\input -> Eithers.map (\t -> Paths.SubtermStepOptionalGiven) (ExtractCore.decodeUnit cx input))),+                      (Core.Name "pairFirst", (\input -> Eithers.map (\t -> Paths.SubtermStepPairFirst) (ExtractCore.decodeUnit cx input))),+                      (Core.Name "pairSecond", (\input -> Eithers.map (\t -> Paths.SubtermStepPairSecond) (ExtractCore.decodeUnit cx input))),                       (Core.Name "recordField", (\input -> Eithers.map (\t -> Paths.SubtermStepRecordField t) (DecodeCore.name cx input))),                       (                         Core.Name "setElement",@@ -147,33 +176,39 @@                               _ -> Left (Errors.DecodingError "expected int32 value")                             _ -> Left (Errors.DecodingError "expected int32 literal")                           _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))),-                      (Core.Name "sumTerm", (\input -> Eithers.map (\t -> Paths.SubtermStepSumTerm) (ExtractCore.decodeUnit cx input))),                       (+                        Core.Name "typeApplicationBody",+                        (\input -> Eithers.map (\t -> Paths.SubtermStepTypeApplicationBody) (ExtractCore.decodeUnit cx input))),+                      (                         Core.Name "typeLambdaBody",                         (\input -> Eithers.map (\t -> Paths.SubtermStepTypeLambdaBody) (ExtractCore.decodeUnit cx input))),-                      (-                        Core.Name "typeApplicationTerm",-                        (\input -> Eithers.map (\t -> Paths.SubtermStepTypeApplicationTerm) (ExtractCore.decodeUnit cx input))),-                      (-                        Core.Name "injectionTerm",-                        (\input -> Eithers.map (\t -> Paths.SubtermStepInjectionTerm) (ExtractCore.decodeUnit cx input))),-                      (Core.Name "wrappedTerm", (\input -> Eithers.map (\t -> Paths.SubtermStepWrappedTerm) (ExtractCore.decodeUnit cx input)))]+                      (Core.Name "wrapBody", (\input -> Eithers.map (\t -> Paths.SubtermStepWrapBody) (ExtractCore.decodeUnit cx input)))]         in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [           "no such field ",           (Core.unName fname),           " in union"]))) (\f -> f fterm))       _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw) +-- | Decoder for hydra.paths.SubtypeAttribute+subtypeAttribute :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.SubtypeAttribute+subtypeAttribute cx raw =+    Eithers.either (\err -> Left err) (\stripped -> case stripped of+      Core.TermRecord v0 ->+        let fieldMap = ExtractCore.toFieldMap v0+        in (Eithers.bind (ExtractCore.requireField "path" subtypePath fieldMap cx) (\field_path -> Eithers.bind (ExtractCore.requireField "target" typeAttribute fieldMap cx) (\field_target -> Right (Paths.SubtypeAttribute {+          Paths.subtypeAttributePath = field_path,+          Paths.subtypeAttributeTarget = field_target}))))+      _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.SubtypeAttribute")) (ExtractCore.stripWithDecodingError cx raw)+ -- | Decoder for hydra.paths.SubtypeEdge subtypeEdge :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.SubtypeEdge subtypeEdge cx raw =     Eithers.either (\err -> Left err) (\stripped -> case stripped of       Core.TermRecord v0 ->         let fieldMap = ExtractCore.toFieldMap v0-        in (Eithers.bind (ExtractCore.requireField "source" subtypeNode fieldMap cx) (\field_source -> Eithers.bind (ExtractCore.requireField "path" subtypePath fieldMap cx) (\field_path -> Eithers.bind (ExtractCore.requireField "target" subtypeNode fieldMap cx) (\field_target -> Right (Paths.SubtypeEdge {-          Paths.subtypeEdgeSource = field_source,+        in (Eithers.bind (ExtractCore.requireField "path" subtypePath fieldMap cx) (\field_path -> Eithers.bind (ExtractCore.requireField "target" DecodeCore.name fieldMap cx) (\field_target -> Right (Paths.SubtypeEdge {           Paths.subtypeEdgePath = field_path,-          Paths.subtypeEdgeTarget = field_target})))))+          Paths.subtypeEdgeTarget = field_target}))))       _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.SubtypeEdge")) (ExtractCore.stripWithDecodingError cx raw)  -- | Decoder for hydra.paths.SubtypeGraph@@ -182,29 +217,38 @@     Eithers.either (\err -> Left err) (\stripped -> case stripped of       Core.TermRecord v0 ->         let fieldMap = ExtractCore.toFieldMap v0-        in (Eithers.bind (ExtractCore.requireField "nodes" (ExtractCore.decodeList subtypeNode) fieldMap cx) (\field_nodes -> Eithers.bind (ExtractCore.requireField "edges" (ExtractCore.decodeList subtypeEdge) fieldMap cx) (\field_edges -> Right (Paths.SubtypeGraph {-          Paths.subtypeGraphNodes = field_nodes,-          Paths.subtypeGraphEdges = field_edges}))))+        in (Eithers.bind (ExtractCore.requireField "nodes" (ExtractCore.decodeList subtypeNode) fieldMap cx) (\field_nodes -> Right (Paths.SubtypeGraph {+          Paths.subtypeGraphNodes = field_nodes})))       _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.SubtypeGraph")) (ExtractCore.stripWithDecodingError cx raw) +-- | Decoder for hydra.paths.SubtypeLink+subtypeLink :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.SubtypeLink+subtypeLink cx raw =+    Eithers.either (\err -> Left err) (\stripped -> case stripped of+      Core.TermInject v0 ->+        let field = Core.injectionField v0+            fname = Core.fieldName field+            fterm = Core.fieldTerm field+            variantMap =+                    Maps.fromList [+                      (Core.Name "edge", (\input -> Eithers.map (\t -> Paths.SubtypeLinkEdge t) (subtypeEdge cx input))),+                      (Core.Name "property", (\input -> Eithers.map (\t -> Paths.SubtypeLinkProperty t) (subtypeProperty cx input))),+                      (Core.Name "attribute", (\input -> Eithers.map (\t -> Paths.SubtypeLinkAttribute t) (subtypeAttribute cx input)))]+        in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+          "no such field ",+          (Core.unName fname),+          " in union"]))) (\f -> f fterm))+      _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)+ -- | Decoder for hydra.paths.SubtypeNode subtypeNode :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.SubtypeNode subtypeNode cx raw =     Eithers.either (\err -> Left err) (\stripped -> case stripped of       Core.TermRecord v0 ->         let fieldMap = ExtractCore.toFieldMap v0-        in (Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "label" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of-          Core.TermLiteral v1 -> case v1 of-            Core.LiteralString v2 -> Right v2-            _ -> Left (Errors.DecodingError "expected string literal")-          _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_label -> Eithers.bind (ExtractCore.requireField "id" (\cx2 -> \raw2 -> Eithers.either (\err -> Left err) (\stripped2 -> case stripped2 of-          Core.TermLiteral v1 -> case v1 of-            Core.LiteralString v2 -> Right v2-            _ -> Left (Errors.DecodingError "expected string literal")-          _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx2 raw2)) fieldMap cx) (\field_id -> Right (Paths.SubtypeNode {+        in (Eithers.bind (ExtractCore.requireField "name" DecodeCore.name fieldMap cx) (\field_name -> Eithers.bind (ExtractCore.requireField "links" (ExtractCore.decodeList subtypeLink) fieldMap cx) (\field_links -> Right (Paths.SubtypeNode {           Paths.subtypeNodeName = field_name,-          Paths.subtypeNodeLabel = field_label,-          Paths.subtypeNodeId = field_id})))))+          Paths.subtypeNodeLinks = field_links}))))       _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.SubtypeNode")) (ExtractCore.stripWithDecodingError cx raw)  -- | Decoder for hydra.paths.SubtypePath@@ -214,6 +258,17 @@       Core.TermWrap v0 -> Eithers.map (\b -> Paths.SubtypePath b) (ExtractCore.decodeList subtypeStep cx (Core.wrappedTermBody v0))       _ -> Left (Errors.DecodingError "expected wrapped type")) (ExtractCore.stripWithDecodingError cx raw) +-- | Decoder for hydra.paths.SubtypeProperty+subtypeProperty :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.SubtypeProperty+subtypeProperty cx raw =+    Eithers.either (\err -> Left err) (\stripped -> case stripped of+      Core.TermRecord v0 ->+        let fieldMap = ExtractCore.toFieldMap v0+        in (Eithers.bind (ExtractCore.requireField "path" subtypePath fieldMap cx) (\field_path -> Eithers.bind (ExtractCore.requireField "target" DecodeCore.type_ fieldMap cx) (\field_target -> Right (Paths.SubtypeProperty {+          Paths.subtypePropertyPath = field_path,+          Paths.subtypePropertyTarget = field_target}))))+      _ -> Left (Errors.DecodingError "expected a record of type hydra.paths.SubtypeProperty")) (ExtractCore.stripWithDecodingError cx raw)+ -- | Decoder for hydra.paths.SubtypeStep subtypeStep :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.SubtypeStep subtypeStep cx raw =@@ -228,20 +283,21 @@                         Core.Name "annotatedBody",                         (\input -> Eithers.map (\t -> Paths.SubtypeStepAnnotatedBody) (ExtractCore.decodeUnit cx input))),                       (-                        Core.Name "applicationFunction",-                        (\input -> Eithers.map (\t -> Paths.SubtypeStepApplicationFunction) (ExtractCore.decodeUnit cx input))),-                      (                         Core.Name "applicationArgument",                         (\input -> Eithers.map (\t -> Paths.SubtypeStepApplicationArgument) (ExtractCore.decodeUnit cx input))),+                      (+                        Core.Name "applicationFunction",+                        (\input -> Eithers.map (\t -> Paths.SubtypeStepApplicationFunction) (ExtractCore.decodeUnit cx input))),+                      (Core.Name "effectValue", (\input -> Eithers.map (\t -> Paths.SubtypeStepEffectValue) (ExtractCore.decodeUnit cx input))),                       (Core.Name "eitherLeft", (\input -> Eithers.map (\t -> Paths.SubtypeStepEitherLeft) (ExtractCore.decodeUnit cx input))),                       (Core.Name "eitherRight", (\input -> Eithers.map (\t -> Paths.SubtypeStepEitherRight) (ExtractCore.decodeUnit cx input))),                       (Core.Name "forallBody", (\input -> Eithers.map (\t -> Paths.SubtypeStepForallBody) (ExtractCore.decodeUnit cx input))),                       (-                        Core.Name "functionDomain",-                        (\input -> Eithers.map (\t -> Paths.SubtypeStepFunctionDomain) (ExtractCore.decodeUnit cx input))),-                      (                         Core.Name "functionCodomain",                         (\input -> Eithers.map (\t -> Paths.SubtypeStepFunctionCodomain) (ExtractCore.decodeUnit cx input))),+                      (+                        Core.Name "functionDomain",+                        (\input -> Eithers.map (\t -> Paths.SubtypeStepFunctionDomain) (ExtractCore.decodeUnit cx input))),                       (Core.Name "listElement", (\input -> Eithers.map (\t -> Paths.SubtypeStepListElement) (ExtractCore.decodeUnit cx input))),                       (Core.Name "mapKeys", (\input -> Eithers.map (\t -> Paths.SubtypeStepMapKeys) (ExtractCore.decodeUnit cx input))),                       (Core.Name "mapValues", (\input -> Eithers.map (\t -> Paths.SubtypeStepMapValues) (ExtractCore.decodeUnit cx input))),@@ -253,7 +309,74 @@                       (Core.Name "recordField", (\input -> Eithers.map (\t -> Paths.SubtypeStepRecordField t) (DecodeCore.name cx input))),                       (Core.Name "setElement", (\input -> Eithers.map (\t -> Paths.SubtypeStepSetElement) (ExtractCore.decodeUnit cx input))),                       (Core.Name "unionField", (\input -> Eithers.map (\t -> Paths.SubtypeStepUnionField t) (DecodeCore.name cx input))),-                      (Core.Name "wrappedType", (\input -> Eithers.map (\t -> Paths.SubtypeStepWrappedType) (ExtractCore.decodeUnit cx input)))]+                      (Core.Name "wrapBody", (\input -> Eithers.map (\t -> Paths.SubtypeStepWrapBody) (ExtractCore.decodeUnit cx input)))]+        in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+          "no such field ",+          (Core.unName fname),+          " in union"]))) (\f -> f fterm))+      _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)++-- | Decoder for hydra.paths.TermAttribute+termAttribute :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.TermAttribute+termAttribute cx raw =+    Eithers.either (\err -> Left err) (\stripped -> case stripped of+      Core.TermInject v0 ->+        let field = Core.injectionField v0+            fname = Core.fieldName field+            fterm = Core.fieldTerm field+            variantMap =+                    Maps.fromList [+                      (Core.Name "casesTypeName", (\input -> Eithers.map (\t -> Paths.TermAttributeCasesTypeName t) (DecodeCore.name cx input))),+                      (+                        Core.Name "injectTypeName",+                        (\input -> Eithers.map (\t -> Paths.TermAttributeInjectTypeName t) (DecodeCore.name cx input))),+                      (+                        Core.Name "lambdaDomainGiven",+                        (\input -> Eithers.map (\t -> Paths.TermAttributeLambdaDomainGiven t) (DecodeCore.type_ cx input))),+                      (+                        Core.Name "lambdaParameter",+                        (\input -> Eithers.map (\t -> Paths.TermAttributeLambdaParameter t) (DecodeCore.name cx input))),+                      (+                        Core.Name "letBindingTypeSchemeGiven",+                        (\input -> Eithers.map (\t -> Paths.TermAttributeLetBindingTypeSchemeGiven t) (ExtractCore.decodePair DecodeCore.name DecodeCore.typeScheme cx input))),+                      (+                        Core.Name "projectFieldName",+                        (\input -> Eithers.map (\t -> Paths.TermAttributeProjectFieldName t) (DecodeCore.name cx input))),+                      (+                        Core.Name "projectTypeName",+                        (\input -> Eithers.map (\t -> Paths.TermAttributeProjectTypeName t) (DecodeCore.name cx input))),+                      (+                        Core.Name "recordTypeName",+                        (\input -> Eithers.map (\t -> Paths.TermAttributeRecordTypeName t) (DecodeCore.name cx input))),+                      (+                        Core.Name "typeApplicationType",+                        (\input -> Eithers.map (\t -> Paths.TermAttributeTypeApplicationType t) (DecodeCore.type_ cx input))),+                      (+                        Core.Name "typeLambdaParameter",+                        (\input -> Eithers.map (\t -> Paths.TermAttributeTypeLambdaParameter t) (DecodeCore.name cx input))),+                      (Core.Name "wrapTypeName", (\input -> Eithers.map (\t -> Paths.TermAttributeWrapTypeName t) (DecodeCore.name cx input)))]+        in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [+          "no such field ",+          (Core.unName fname),+          " in union"]))) (\f -> f fterm))+      _ -> Left (Errors.DecodingError "expected union")) (ExtractCore.stripWithDecodingError cx raw)++-- | Decoder for hydra.paths.TypeAttribute+typeAttribute :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Paths.TypeAttribute+typeAttribute cx raw =+    Eithers.either (\err -> Left err) (\stripped -> case stripped of+      Core.TermInject v0 ->+        let field = Core.injectionField v0+            fname = Core.fieldName field+            fterm = Core.fieldTerm field+            variantMap =+                    Maps.fromList [+                      (+                        Core.Name "annotatedAnnotation",+                        (\input -> Eithers.map (\t -> Paths.TypeAttributeAnnotatedAnnotation t) (DecodeCore.term cx input))),+                      (+                        Core.Name "forallParameter",+                        (\input -> Eithers.map (\t -> Paths.TypeAttributeForallParameter t) (DecodeCore.name cx input)))]         in (Optionals.match (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [           "no such field ",           (Core.unName fname),
src/main/haskell/Hydra/Decode/Query.hs view
@@ -19,6 +19,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.query.ComparisonConstraint comparisonConstraint :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Query.ComparisonConstraint
src/main/haskell/Hydra/Decode/Regex.hs view
@@ -19,6 +19,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.regex.Alternation alternation :: Graph.Graph -> Core.Term -> Either Errors.DecodingError [Regex.RegexSequence]
src/main/haskell/Hydra/Decode/Relational.hs view
@@ -16,6 +16,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.relational.ColumnName columnName :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Relational.ColumnName
src/main/haskell/Hydra/Decode/System.hs view
@@ -17,6 +17,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.system.Command command :: Graph.Graph -> Core.Term -> Either Errors.DecodingError System.Command
src/main/haskell/Hydra/Decode/Tabular.hs view
@@ -17,6 +17,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.tabular.ColumnType columnType :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Tabular.ColumnType
src/main/haskell/Hydra/Decode/Testing.hs view
@@ -16,6 +16,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.testing.Tag tag :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Testing.Tag
src/main/haskell/Hydra/Decode/Time.hs view
@@ -16,6 +16,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.time.Timespec timespec :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Time.Timespec
src/main/haskell/Hydra/Decode/Topology.hs view
@@ -16,6 +16,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | Decoder for hydra.topology.Graph
src/main/haskell/Hydra/Decode/Typed.hs view
@@ -16,6 +16,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.typed.TypedBinding typedBinding :: (Graph.Graph -> Core.Term -> Either Errors.DecodingError a) -> Graph.Graph -> Core.Term -> Either Errors.DecodingError (Typed.TypedBinding a)
src/main/haskell/Hydra/Decode/Typing.hs view
@@ -17,6 +17,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.typing.FunctionStructure functionStructure :: (Graph.Graph -> Core.Term -> Either Errors.DecodingError env) -> Graph.Graph -> Core.Term -> Either Errors.DecodingError (Typing.FunctionStructure env)
src/main/haskell/Hydra/Decode/Util.hs view
@@ -19,6 +19,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.util.CaseConvention caseConvention :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Util.CaseConvention
src/main/haskell/Hydra/Decode/Validation.hs view
@@ -17,6 +17,7 @@ import qualified Hydra.Validation as Validation import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.validation.ValidationProfile validationProfile :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Validation.ValidationProfile
src/main/haskell/Hydra/Decode/Variants.hs view
@@ -19,6 +19,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.variants.LiteralVariant literalVariant :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Variants.LiteralVariant
src/main/haskell/Hydra/Decode/Yaml/Model.hs view
@@ -19,6 +19,7 @@ import qualified Hydra.Yaml.Model as Model import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Decoder for hydra.yaml.model.Node node :: Graph.Graph -> Core.Term -> Either Errors.DecodingError Model.Node
src/main/haskell/Hydra/Decoding.hs view
@@ -29,6 +29,7 @@ import qualified Hydra.Overlay.Haskell.Lib.Logic as Logic import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Overlay.Haskell.Lib.Sets as Sets import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings import qualified Hydra.Names as Names import qualified Hydra.Packaging as Packaging@@ -53,6 +54,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Collect forall type variable names from a type collectForallVariables :: Core.Type -> [Core.Name]@@ -1516,8 +1518,8 @@           Core.bindingTypeScheme = (Just (Core.TypeScheme {             Core.typeSchemeVariables = [],             Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Type")),-            Core.typeSchemeConstraints = Nothing}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))-      _ -> Nothing) (Packaging.moduleDefinitions mod)))) (\typeBindings -> Logic.ifElse (Lists.null typeBindings) (Right Nothing) (Eithers.bind (Eithers.mapList (\b -> Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\x -> x) (decodeBinding cx graph b)) typeBindings) (\decodedBindings ->+            Core.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))+      _ -> Nothing) (Packaging.moduleDefinitions mod)))) (\typeBindings -> Logic.ifElse (Lists.isEmpty typeBindings) (Right Nothing) (Eithers.bind (Eithers.mapList (\b -> Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\x -> x) (decodeBinding cx graph b)) typeBindings) (\decodedBindings ->       let allDecodedDeps =               Lists.distinct (Lists.map decodeModuleName (Lists.map (\dep -> Packaging.moduleDependencyModule dep) (Packaging.moduleDependencies mod)))       in (Right (Just (Packaging.Module {@@ -1681,7 +1683,7 @@                                   Core.typeSchemeBody = (Core.TypeMap (Core.MapType {                                     Core.mapTypeKeys = (Core.TypeVariable (Core.Name "hydra.core.Name")),                                     Core.mapTypeValues = (Core.TypeVariable (Core.Name "hydra.core.Term"))})),-                                  Core.typeSchemeConstraints = Nothing}))}],+                                  Core.typeSchemeConstraints = Maps.empty}))}],                             Core.letBody = decodeBody}))}))}]})),                   Core.applicationArgument = (Core.TermVariable (Core.Name "stripped"))}))}))})),             Core.applicationArgument = (Core.TermApplication (Core.Application {@@ -1896,7 +1898,7 @@                                 Core.bindingTypeScheme = (Just (Core.TypeScheme {                                   Core.typeSchemeVariables = [],                                   Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Field")),-                                  Core.typeSchemeConstraints = Nothing}))},+                                  Core.typeSchemeConstraints = Maps.empty}))},                               Core.Binding {                                 Core.bindingName = (Core.Name "fname"),                                 Core.bindingTerm = (Core.TermApplication (Core.Application {@@ -1907,7 +1909,7 @@                                 Core.bindingTypeScheme = (Just (Core.TypeScheme {                                   Core.typeSchemeVariables = [],                                   Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Name")),-                                  Core.typeSchemeConstraints = Nothing}))},+                                  Core.typeSchemeConstraints = Maps.empty}))},                               Core.Binding {                                 Core.bindingName = (Core.Name "fterm"),                                 Core.bindingTerm = (Core.TermApplication (Core.Application {@@ -1918,7 +1920,7 @@                                 Core.bindingTypeScheme = (Just (Core.TypeScheme {                                   Core.typeSchemeVariables = [],                                   Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Term")),-                                  Core.typeSchemeConstraints = Nothing}))},+                                  Core.typeSchemeConstraints = Maps.empty}))},                               Core.Binding {                                 Core.bindingName = (Core.Name "variantMap"),                                 Core.bindingTerm = (Core.TermApplication (Core.Application {@@ -1933,7 +1935,7 @@                                   Core.typeSchemeBody = (Core.TypeMap (Core.MapType {                                     Core.mapTypeKeys = nameType,                                     Core.mapTypeValues = variantFnType})),-                                  Core.typeSchemeConstraints = Nothing}))}],+                                  Core.typeSchemeConstraints = Maps.empty}))}],                             Core.letBody = (Core.TermApplication (Core.Application {                               Core.applicationFunction = (Core.TermApplication (Core.Application {                                 Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -2198,11 +2200,10 @@           allOrdVars = collectOrdConstrainedVariables typ           ordVars = Lists.filter (\v -> Lists.member v typeVars) allOrdVars           constraints =-                  Logic.ifElse (Lists.null ordVars) Nothing (Just (Maps.fromList (Lists.map (\v -> (+                  Maps.fromList (Lists.map (\v -> (                     v,                     Core.TypeVariableConstraints {-                      Core.typeVariableConstraintsClasses = [-                        Core.TypeClassConstraintSimple (Core.Name "ordering")]})) ordVars)))+                      Core.typeVariableConstraintsClasses = (Sets.singleton (Core.TypeClassConstraintSimple (Core.Name "ordering")))})) ordVars)       in Core.TypeScheme {         Core.typeSchemeVariables = typeVars,         Core.typeSchemeBody = (decoderType typ),@@ -2216,11 +2217,10 @@           allOrdVars = collectOrdConstrainedVariables typ           ordVars = Lists.filter (\v -> Lists.member v typeVars) allOrdVars           constraints =-                  Logic.ifElse (Lists.null ordVars) Nothing (Just (Maps.fromList (Lists.map (\v -> (+                  Maps.fromList (Lists.map (\v -> (                     v,                     Core.TypeVariableConstraints {-                      Core.typeVariableConstraintsClasses = [-                        Core.TypeClassConstraintSimple (Core.Name "ordering")]})) ordVars)))+                      Core.typeVariableConstraintsClasses = (Sets.singleton (Core.TypeClassConstraintSimple (Core.Name "ordering")))})) ordVars)       in Core.TypeScheme {         Core.typeSchemeVariables = typeVars,         Core.typeSchemeBody = (decoderTypeNamed ename typ),
src/main/haskell/Hydra/Dependencies.hs view
@@ -55,6 +55,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S @@ -135,7 +136,7 @@                       Core.TermLet v0 ->                         let bindings = Core.letBindings v0                             body = Core.letBody v0-                            forResult = \hr -> Lists.concat2 (Pairs.second hr) (Lists.pure (Pairs.first hr))+                            forResult = \hr -> Lists.concat2 (Pairs.second hr) (Lists.singleton (Pairs.first hr))                             flattenedBindings = Lists.concat (Lists.map (\arg_ -> forResult (rewriteBinding arg_)) bindings)                             merged = flattenBodyLet flattenedBindings body                             newBindings = Pairs.first merged@@ -234,7 +235,7 @@                       forTypeScheme =                               \ts ->                                 let t = Core.typeSchemeBody ts-                                in (Logic.ifElse (Lists.null (Core.typeSchemeVariables ts)) (forMono t) typ)+                                in (Logic.ifElse (Lists.isEmpty (Core.typeSchemeVariables ts)) (forMono t) typ)                   in (Optionals.match (Maps.lookup v0 types) typ (\ts -> forTypeScheme ts))                 Core.TypeWrap _ -> typ                 _ -> recurse typ@@ -305,7 +306,7 @@                         names = Pairs.second localNames                         rangeFrom = \start -> Lists.cons start (rangeFrom (Math.add start 1))                         rename =-                                \name -> \i -> (name, (Core.Name (Logic.ifElse (Ordering.gt i 1) (Strings.concat2 local (Literals.showInt32 i)) local)))+                                \name -> \i -> (name, (Core.Name (Logic.ifElse (Ordering.gt i 1) (Strings.concat2 local (Literals.printInt32 i)) local)))                     in (Lists.zipWith rename (Sets.toList names) (rangeFrom 1))       in (Maps.fromList (Lists.concat (Lists.map renameGroup (Maps.toList groups)))) 
src/main/haskell/Hydra/Differentiation.hs view
@@ -42,6 +42,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Differentiate a binary primitive application given both arguments and their derivatives differentiateBinary :: Core.Name -> Core.Term -> Core.Term -> Core.Term -> Core.Term -> Core.Term
src/main/haskell/Hydra/Docs.hs view
@@ -8,6 +8,7 @@ import qualified Hydra.Packaging as Packaging import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | A segment of a documentation string, either a raw text fragment or an inline entity reference. Documentation strings are parsed into a sequence of DocSegments for host-specific rendering. data DocSegment =
src/main/haskell/Hydra/Dsl/Analysis.hs view
@@ -89,6 +89,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Set as S  -- | DSL reference to hydra.analysis.addNamesToModuleNames
src/main/haskell/Hydra/Dsl/Annotations.hs view
@@ -75,11 +75,12 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S  -- | DSL reference to hydra.annotations.aggregateAnnotations-aggregateAnnotations :: Ord t2 => (Typed.TypedTerm (t0 -> Maybe t1) -> Typed.TypedTerm (t1 -> t0) -> Typed.TypedTerm (t1 -> M.Map t2 t3) -> Typed.TypedTerm t0 -> Typed.TypedTerm (M.Map t2 t3))+aggregateAnnotations :: Typed.TypedTerm (t0 -> Maybe t1) -> Typed.TypedTerm (t1 -> t0) -> Typed.TypedTerm (t1 -> M.Map t2 t3) -> Typed.TypedTerm t0 -> Typed.TypedTerm (M.Map t2 t3) aggregateAnnotations arg0 arg1 arg2 arg3 =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -227,7 +228,7 @@       Core.applicationArgument = (Typed.unTypedTerm arg0)}))  -- | DSL reference to hydra.annotations.setAnnotation-setAnnotation :: Ord t0 => (Typed.TypedTerm t0 -> Typed.TypedTerm (Maybe t1) -> Typed.TypedTerm (M.Map t0 t1) -> Typed.TypedTerm (M.Map t0 t1))+setAnnotation :: Typed.TypedTerm t0 -> Typed.TypedTerm (Maybe t1) -> Typed.TypedTerm (M.Map t0 t1) -> Typed.TypedTerm (M.Map t0 t1) setAnnotation arg0 arg1 arg2 =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {
src/main/haskell/Hydra/Dsl/Arity.hs view
@@ -64,6 +64,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.arity.primitiveArity primitiveArity :: Typed.TypedTerm Graph.Primitive -> Typed.TypedTerm Int
src/main/haskell/Hydra/Dsl/Ast.hs view
@@ -12,6 +12,7 @@ import qualified Hydra.Typed as Typed import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL name token for hydra.ast.Associativity associativityAssociativity :: Typed.TypedName Ast.Associativity
src/main/haskell/Hydra/Dsl/Checking.hs view
@@ -90,6 +90,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S 
src/main/haskell/Hydra/Dsl/Coders.hs view
@@ -22,6 +22,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S 
src/main/haskell/Hydra/Dsl/Constants.hs view
@@ -64,6 +64,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.constants.fieldNameValue fieldNameValue :: Typed.TypedTerm String
src/main/haskell/Hydra/Dsl/Core.hs view
@@ -10,6 +10,7 @@ import qualified Hydra.Typed as Typed import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.ByteString as B import qualified Data.Int as I import qualified Data.Map as M@@ -2270,7 +2271,7 @@         Core.fieldTerm = (Typed.unTypedTerm x)}}))  -- | DSL constructor for hydra.core.TypeScheme-typeScheme :: Typed.TypedTerm [Core.Name] -> Typed.TypedTerm Core.Type -> Typed.TypedTerm (Maybe (M.Map Core.Name Core.TypeVariableConstraints)) -> Typed.TypedTerm Core.TypeScheme+typeScheme :: Typed.TypedTerm [Core.Name] -> Typed.TypedTerm Core.Type -> Typed.TypedTerm (M.Map Core.Name Core.TypeVariableConstraints) -> Typed.TypedTerm Core.TypeScheme typeScheme variables body constraints =     Typed.TypedTerm (Core.TermRecord (Core.Record {       Core.recordTypeName = (Core.Name "hydra.core.TypeScheme"),@@ -2295,7 +2296,7 @@       Core.applicationArgument = (Typed.unTypedTerm x)}))  -- | DSL accessor for the constraints field of hydra.core.TypeScheme-typeSchemeConstraints :: Typed.TypedTerm Core.TypeScheme -> Typed.TypedTerm (Maybe (M.Map Core.Name Core.TypeVariableConstraints))+typeSchemeConstraints :: Typed.TypedTerm Core.TypeScheme -> Typed.TypedTerm (M.Map Core.Name Core.TypeVariableConstraints) typeSchemeConstraints x =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermProject (Core.Projection {@@ -2341,7 +2342,7 @@             Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))  -- | DSL updater for the constraints field of hydra.core.TypeScheme-typeSchemeWithConstraints :: Typed.TypedTerm Core.TypeScheme -> Typed.TypedTerm (Maybe (M.Map Core.Name Core.TypeVariableConstraints)) -> Typed.TypedTerm Core.TypeScheme+typeSchemeWithConstraints :: Typed.TypedTerm Core.TypeScheme -> Typed.TypedTerm (M.Map Core.Name Core.TypeVariableConstraints) -> Typed.TypedTerm Core.TypeScheme typeSchemeWithConstraints original newVal =     Typed.TypedTerm (Core.TermRecord (Core.Record {       Core.recordTypeName = (Core.Name "hydra.core.TypeScheme"),@@ -2429,7 +2430,7 @@         Core.fieldTerm = (Typed.unTypedTerm x)}}))  -- | DSL constructor for hydra.core.TypeVariableConstraints-typeVariableConstraints :: Typed.TypedTerm [Core.TypeClassConstraint] -> Typed.TypedTerm Core.TypeVariableConstraints+typeVariableConstraints :: Typed.TypedTerm (S.Set Core.TypeClassConstraint) -> Typed.TypedTerm Core.TypeVariableConstraints typeVariableConstraints classes =     Typed.TypedTerm (Core.TermRecord (Core.Record {       Core.recordTypeName = (Core.Name "hydra.core.TypeVariableConstraints"),@@ -2439,7 +2440,7 @@           Core.fieldTerm = (Typed.unTypedTerm classes)}]}))  -- | DSL accessor for the classes field of hydra.core.TypeVariableConstraints-typeVariableConstraintsClasses :: Typed.TypedTerm Core.TypeVariableConstraints -> Typed.TypedTerm [Core.TypeClassConstraint]+typeVariableConstraintsClasses :: Typed.TypedTerm Core.TypeVariableConstraints -> Typed.TypedTerm (S.Set Core.TypeClassConstraint) typeVariableConstraintsClasses x =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermProject (Core.Projection {@@ -2452,7 +2453,7 @@ typeVariableConstraintsTypeVariableConstraints = Typed.TypedName (Core.Name "hydra.core.TypeVariableConstraints")  -- | DSL updater for the classes field of hydra.core.TypeVariableConstraints-typeVariableConstraintsWithClasses :: Typed.TypedTerm Core.TypeVariableConstraints -> Typed.TypedTerm [Core.TypeClassConstraint] -> Typed.TypedTerm Core.TypeVariableConstraints+typeVariableConstraintsWithClasses :: Typed.TypedTerm Core.TypeVariableConstraints -> Typed.TypedTerm (S.Set Core.TypeClassConstraint) -> Typed.TypedTerm Core.TypeVariableConstraints typeVariableConstraintsWithClasses original newVal =     Typed.TypedTerm (Core.TermRecord (Core.Record {       Core.recordTypeName = (Core.Name "hydra.core.TypeVariableConstraints"),
src/main/haskell/Hydra/Dsl/Dependencies.hs view
@@ -80,6 +80,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S @@ -198,7 +199,7 @@       Core.applicationArgument = (Typed.unTypedTerm arg1)}))  -- | DSL reference to hydra.dependencies.typeNamesInType-typeNamesInType :: Ord t0 => (Typed.TypedTerm Core.Type -> Typed.TypedTerm (S.Set t0))+typeNamesInType :: Typed.TypedTerm Core.Type -> Typed.TypedTerm (S.Set t0) typeNamesInType arg0 =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.dependencies.typeNamesInType")),
src/main/haskell/Hydra/Dsl/Docs.hs view
@@ -13,6 +13,7 @@ import qualified Hydra.Typed as Typed import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL name token for hydra.docs.DocSegment docSegmentDocSegment :: Typed.TypedName Docs.DocSegment
src/main/haskell/Hydra/Dsl/Environment.hs view
@@ -76,6 +76,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | DSL reference to hydra.environment.definitionAsTypeApplicationTerm
src/main/haskell/Hydra/Dsl/Error/Checking.hs view
@@ -18,6 +18,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Set as S  -- | DSL name token for hydra.error.checking.CheckingError
src/main/haskell/Hydra/Dsl/Error/Core.hs view
@@ -16,6 +16,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL constructor for hydra.error.core.ConstantConditionError constantConditionError :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Bool -> Typed.TypedTerm ErrorCore.ConstantConditionError
src/main/haskell/Hydra/Dsl/Error/File.hs view
@@ -13,6 +13,7 @@ import qualified Hydra.Typed as Typed import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL injection for the alreadyExists variant of hydra.error.file.FileError fileErrorAlreadyExists :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm ErrorFile.FileError
src/main/haskell/Hydra/Dsl/Error/Packaging.hs view
@@ -16,6 +16,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL constructor for hydra.error.packaging.ConflictingModuleNameError conflictingModuleNameError :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm ErrorPackaging.ConflictingModuleNameError
src/main/haskell/Hydra/Dsl/Error/System.hs view
@@ -13,6 +13,7 @@ import qualified Hydra.Typed as Typed import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL injection for the commandNotFound variant of hydra.error.system.SystemError systemErrorCommandNotFound :: Typed.TypedTerm File.FilePath -> Typed.TypedTerm System.SystemError
src/main/haskell/Hydra/Dsl/Errors.hs view
@@ -22,6 +22,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL constructor for the hydra.errors.DecodingError wrapper decodingError :: Typed.TypedTerm String -> Typed.TypedTerm Errors.DecodingError
src/main/haskell/Hydra/Dsl/Extract/Json.hs view
@@ -66,6 +66,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | DSL reference to hydra.extract.json.expectArray@@ -97,7 +98,7 @@       Core.applicationArgument = (Typed.unTypedTerm arg0)}))  -- | DSL reference to hydra.extract.json.opt-opt :: Ord t0 => (Typed.TypedTerm t0 -> Typed.TypedTerm (M.Map t0 t1) -> Typed.TypedTerm (Maybe t1))+opt :: Typed.TypedTerm t0 -> Typed.TypedTerm (M.Map t0 t1) -> Typed.TypedTerm (Maybe t1) opt arg0 arg1 =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -106,7 +107,7 @@       Core.applicationArgument = (Typed.unTypedTerm arg1)}))  -- | DSL reference to hydra.extract.json.optArray-optArray :: Ord t0 => (Typed.TypedTerm t0 -> Typed.TypedTerm (M.Map t0 Model.Value) -> Typed.TypedTerm (Either String (Maybe [Model.Value])))+optArray :: Typed.TypedTerm t0 -> Typed.TypedTerm (M.Map t0 Model.Value) -> Typed.TypedTerm (Either String (Maybe [Model.Value])) optArray arg0 arg1 =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -115,7 +116,7 @@       Core.applicationArgument = (Typed.unTypedTerm arg1)}))  -- | DSL reference to hydra.extract.json.optString-optString :: Ord t0 => (Typed.TypedTerm t0 -> Typed.TypedTerm (M.Map t0 Model.Value) -> Typed.TypedTerm (Either String (Maybe String)))+optString :: Typed.TypedTerm t0 -> Typed.TypedTerm (M.Map t0 Model.Value) -> Typed.TypedTerm (Either String (Maybe String)) optString arg0 arg1 =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {
src/main/haskell/Hydra/Dsl/File.hs view
@@ -14,6 +14,7 @@ import qualified Hydra.Typed as Typed import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Int as I  -- | DSL constructor for the hydra.file.FileExtension wrapper
src/main/haskell/Hydra/Dsl/Formatting.hs view
@@ -64,6 +64,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Set as S  -- | DSL reference to hydra.formatting.capitalize
src/main/haskell/Hydra/Dsl/Graph.hs view
@@ -16,6 +16,7 @@ import qualified Hydra.Typing as Typing import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S 
src/main/haskell/Hydra/Dsl/Json/Bootstrap.hs view
@@ -30,6 +30,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | DSL reference to hydra.json.bootstrap.typesByName
src/main/haskell/Hydra/Dsl/Json/Decode.hs view
@@ -72,6 +72,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | DSL reference to hydra.json.decode.decodeFloat
src/main/haskell/Hydra/Dsl/Json/Decoding.hs view
@@ -64,6 +64,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | DSL reference to hydra.json.decoding.decodeArray@@ -101,7 +102,7 @@       Core.applicationArgument = (Typed.unTypedTerm arg0)}))  -- | DSL reference to hydra.json.decoding.decodeOptionalField-decodeOptionalField :: Ord t3 => (Typed.TypedTerm (t0 -> Either t1 t2) -> Typed.TypedTerm t3 -> Typed.TypedTerm (M.Map t3 t0) -> Typed.TypedTerm (Either t1 (Maybe t2)))+decodeOptionalField :: Typed.TypedTerm (t0 -> Either t1 t2) -> Typed.TypedTerm t3 -> Typed.TypedTerm (M.Map t3 t0) -> Typed.TypedTerm (Either t1 (Maybe t2)) decodeOptionalField arg0 arg1 arg2 =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {
src/main/haskell/Hydra/Dsl/Json/Encode.hs view
@@ -72,6 +72,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | DSL reference to hydra.json.encode.encodeFloat
src/main/haskell/Hydra/Dsl/Json/Model.hs view
@@ -12,6 +12,7 @@ import qualified Hydra.Typed as Typed import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL injection for the array variant of hydra.json.model.Value valueArray :: Typed.TypedTerm [Model.Value] -> Typed.TypedTerm Model.Value
src/main/haskell/Hydra/Dsl/Json/Parser.hs view
@@ -65,6 +65,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.json.parser.digit digit :: Typed.TypedTerm (Parsing.Parser Int)
src/main/haskell/Hydra/Dsl/Json/Writer.hs view
@@ -66,6 +66,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.json.writer.colonOp colonOp :: Typed.TypedTerm Ast.Op
src/main/haskell/Hydra/Dsl/Json/Yaml/Decode.hs view
@@ -68,6 +68,7 @@ import qualified Hydra.Yaml.Model as YamlModel import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | DSL reference to hydra.json.yaml.decode.fromYaml
src/main/haskell/Hydra/Dsl/Json/Yaml/Encode.hs view
@@ -68,6 +68,7 @@ import qualified Hydra.Yaml.Model as YamlModel import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | DSL reference to hydra.json.yaml.encode.jsonToYaml
src/main/haskell/Hydra/Dsl/Lexical.hs view
@@ -70,6 +70,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S 
src/main/haskell/Hydra/Dsl/Lib/Chars.hs view
@@ -63,6 +63,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.lib.chars.isAlpha isAlpha :: Typed.TypedTerm Int -> Typed.TypedTerm Bool
src/main/haskell/Hydra/Dsl/Lib/Defaults.hs view
@@ -20,6 +20,7 @@ import qualified Hydra.Typed as Typed import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | DSL reference to hydra.lib.defaults.defaultImplementations
src/main/haskell/Hydra/Dsl/Lib/Effects.hs view
@@ -63,6 +63,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Set as S  -- | DSL reference to hydra.lib.effects.apply@@ -133,7 +134,7 @@       Core.applicationArgument = (Typed.unTypedTerm m)}))  -- | DSL reference to hydra.lib.effects.mapSet-mapSet :: (Ord x, Ord y) => (Typed.TypedTerm (x -> IO y) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (IO (S.Set y)))+mapSet :: Typed.TypedTerm (x -> IO y) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (IO (S.Set y)) mapSet f s =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {
src/main/haskell/Hydra/Dsl/Lib/Eithers.hs view
@@ -63,6 +63,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Set as S  -- | DSL reference to hydra.lib.eithers.apply@@ -141,6 +142,13 @@       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.isRight")),       Core.applicationArgument = (Typed.unTypedTerm e)})) +-- | DSL reference to hydra.lib.eithers.left+left :: Typed.TypedTerm x -> Typed.TypedTerm (Either x y)+left x =+    Typed.TypedTerm (Core.TermApplication (Core.Application {+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.left")),+      Core.applicationArgument = (Typed.unTypedTerm x)}))+ -- | DSL reference to hydra.lib.eithers.lefts lefts :: Typed.TypedTerm [Either x y] -> Typed.TypedTerm [x] lefts xs =@@ -176,7 +184,7 @@       Core.applicationArgument = (Typed.unTypedTerm m)}))  -- | DSL reference to hydra.lib.eithers.mapSet-mapSet :: (Ord x, Ord y) => (Typed.TypedTerm (x -> Either z y) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (Either z (S.Set y)))+mapSet :: Typed.TypedTerm (x -> Either z y) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (Either z (S.Set y)) mapSet f s =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -191,11 +199,11 @@       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.partition")),       Core.applicationArgument = (Typed.unTypedTerm xs)})) --- | DSL reference to hydra.lib.eithers.pure-pure :: Typed.TypedTerm y -> Typed.TypedTerm (Either x y)-pure x =+-- | DSL reference to hydra.lib.eithers.right+right :: Typed.TypedTerm y -> Typed.TypedTerm (Either x y)+right x =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.pure")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.right")),       Core.applicationArgument = (Typed.unTypedTerm x)}))  -- | DSL reference to hydra.lib.eithers.rights
src/main/haskell/Hydra/Dsl/Lib/Equality.hs view
@@ -63,6 +63,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.lib.equality.equal equal :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Bool
src/main/haskell/Hydra/Dsl/Lib/Files.hs view
@@ -63,6 +63,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.ByteString as B  -- | DSL reference to hydra.lib.files.appendFile
src/main/haskell/Hydra/Dsl/Lib/Functions.hs view
@@ -63,6 +63,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.lib.functions.compose compose :: Typed.TypedTerm (t2 -> t3) -> Typed.TypedTerm (t1 -> t2) -> Typed.TypedTerm t1 -> Typed.TypedTerm t3
src/main/haskell/Hydra/Dsl/Lib/Lists.hs view
@@ -63,6 +63,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Set as S  -- | DSL reference to hydra.lib.lists.apply@@ -234,6 +235,13 @@         Core.applicationArgument = (Typed.unTypedTerm sep)})),       Core.applicationArgument = (Typed.unTypedTerm xs)})) +-- | DSL reference to hydra.lib.lists.isEmpty+isEmpty :: Typed.TypedTerm [x] -> Typed.TypedTerm Bool+isEmpty xs =+    Typed.TypedTerm (Core.TermApplication (Core.Application {+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.isEmpty")),+      Core.applicationArgument = (Typed.unTypedTerm xs)}))+ -- | DSL reference to hydra.lib.lists.join join :: Typed.TypedTerm [x] -> Typed.TypedTerm [[x]] -> Typed.TypedTerm [x] join sep xss =@@ -285,7 +293,7 @@       Core.applicationArgument = (Typed.unTypedTerm m)}))  -- | DSL reference to hydra.lib.lists.mapSet-mapSet :: (Ord x, Ord y) => (Typed.TypedTerm (x -> [y]) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm [S.Set y])+mapSet :: Typed.TypedTerm (x -> [y]) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm [S.Set y] mapSet f s =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -302,13 +310,6 @@         Core.applicationArgument = (Typed.unTypedTerm x)})),       Core.applicationArgument = (Typed.unTypedTerm xs)})) --- | DSL reference to hydra.lib.lists.null-null :: Typed.TypedTerm [x] -> Typed.TypedTerm Bool-null xs =-    Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.null")),-      Core.applicationArgument = (Typed.unTypedTerm xs)}))- -- | DSL reference to hydra.lib.lists.partition partition :: Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm [x] -> Typed.TypedTerm ([x], [x]) partition p xs =@@ -317,13 +318,6 @@         Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.partition")),         Core.applicationArgument = (Typed.unTypedTerm p)})),       Core.applicationArgument = (Typed.unTypedTerm xs)}))---- | DSL reference to hydra.lib.lists.pure-pure :: Typed.TypedTerm x -> Typed.TypedTerm [x]-pure x =-    Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.pure")),-      Core.applicationArgument = (Typed.unTypedTerm x)}))  -- | DSL reference to hydra.lib.lists.replicate replicate :: Typed.TypedTerm Int -> Typed.TypedTerm x -> Typed.TypedTerm [x]
src/main/haskell/Hydra/Dsl/Lib/Literals.hs view
@@ -63,6 +63,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.ByteString as B import qualified Data.Int as I @@ -227,6 +228,13 @@       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.int8ToBigint")),       Core.applicationArgument = (Typed.unTypedTerm x)})) +-- | DSL reference to hydra.lib.literals.parseBigint+parseBigint :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Integer)+parseBigint s =+    Typed.TypedTerm (Core.TermApplication (Core.Application {+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseBigint")),+      Core.applicationArgument = (Typed.unTypedTerm s)}))+ -- | DSL reference to hydra.lib.literals.parseBoolean parseBoolean :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Bool) parseBoolean s =@@ -234,193 +242,186 @@       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseBoolean")),       Core.applicationArgument = (Typed.unTypedTerm s)})) --- | DSL reference to hydra.lib.literals.parseString-parseString :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe String)-parseString s =+-- | DSL reference to hydra.lib.literals.parseDecimal+parseDecimal :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Sci.Scientific)+parseDecimal s =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseString")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseDecimal")),       Core.applicationArgument = (Typed.unTypedTerm s)})) --- | DSL reference to hydra.lib.literals.printBoolean-printBoolean :: Typed.TypedTerm Bool -> Typed.TypedTerm String-printBoolean b =-    Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printBoolean")),-      Core.applicationArgument = (Typed.unTypedTerm b)}))---- | DSL reference to hydra.lib.literals.printString-printString :: Typed.TypedTerm String -> Typed.TypedTerm String-printString s =+-- | DSL reference to hydra.lib.literals.parseFloat32+parseFloat32 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Float)+parseFloat32 s =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printString")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseFloat32")),       Core.applicationArgument = (Typed.unTypedTerm s)})) --- | DSL reference to hydra.lib.literals.readBigint-readBigint :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Integer)-readBigint s =+-- | DSL reference to hydra.lib.literals.parseFloat64+parseFloat64 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Double)+parseFloat64 s =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readBigint")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseFloat64")),       Core.applicationArgument = (Typed.unTypedTerm s)})) --- | DSL reference to hydra.lib.literals.readDecimal-readDecimal :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Sci.Scientific)-readDecimal s =+-- | DSL reference to hydra.lib.literals.parseInt16+parseInt16 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int16)+parseInt16 s =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readDecimal")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseInt16")),       Core.applicationArgument = (Typed.unTypedTerm s)})) --- | DSL reference to hydra.lib.literals.readFloat32-readFloat32 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Float)-readFloat32 s =+-- | DSL reference to hydra.lib.literals.parseInt32+parseInt32 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Int)+parseInt32 s =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readFloat32")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseInt32")),       Core.applicationArgument = (Typed.unTypedTerm s)})) --- | DSL reference to hydra.lib.literals.readFloat64-readFloat64 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Double)-readFloat64 s =+-- | DSL reference to hydra.lib.literals.parseInt64+parseInt64 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int64)+parseInt64 s =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readFloat64")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseInt64")),       Core.applicationArgument = (Typed.unTypedTerm s)})) --- | DSL reference to hydra.lib.literals.readInt16-readInt16 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int16)-readInt16 s =+-- | DSL reference to hydra.lib.literals.parseInt8+parseInt8 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int8)+parseInt8 s =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readInt16")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseInt8")),       Core.applicationArgument = (Typed.unTypedTerm s)})) --- | DSL reference to hydra.lib.literals.readInt32-readInt32 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Int)-readInt32 s =+-- | DSL reference to hydra.lib.literals.parseString+parseString :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe String)+parseString s =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readInt32")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseString")),       Core.applicationArgument = (Typed.unTypedTerm s)})) --- | DSL reference to hydra.lib.literals.readInt64-readInt64 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int64)-readInt64 s =+-- | DSL reference to hydra.lib.literals.parseUint16+parseUint16 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Int)+parseUint16 s =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readInt64")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseUint16")),       Core.applicationArgument = (Typed.unTypedTerm s)})) --- | DSL reference to hydra.lib.literals.readInt8-readInt8 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int8)-readInt8 s =+-- | DSL reference to hydra.lib.literals.parseUint32+parseUint32 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int64)+parseUint32 s =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readInt8")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseUint32")),       Core.applicationArgument = (Typed.unTypedTerm s)})) --- | DSL reference to hydra.lib.literals.readUint16-readUint16 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Int)-readUint16 s =+-- | DSL reference to hydra.lib.literals.parseUint64+parseUint64 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Integer)+parseUint64 s =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readUint16")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseUint64")),       Core.applicationArgument = (Typed.unTypedTerm s)})) --- | DSL reference to hydra.lib.literals.readUint32-readUint32 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int64)-readUint32 s =+-- | DSL reference to hydra.lib.literals.parseUint8+parseUint8 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int16)+parseUint8 s =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readUint32")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseUint8")),       Core.applicationArgument = (Typed.unTypedTerm s)})) --- | DSL reference to hydra.lib.literals.readUint64-readUint64 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Integer)-readUint64 s =+-- | DSL reference to hydra.lib.literals.printBigint+printBigint :: Typed.TypedTerm Integer -> Typed.TypedTerm String+printBigint x =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readUint64")),-      Core.applicationArgument = (Typed.unTypedTerm s)}))+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printBigint")),+      Core.applicationArgument = (Typed.unTypedTerm x)})) --- | DSL reference to hydra.lib.literals.readUint8-readUint8 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int16)-readUint8 s =+-- | DSL reference to hydra.lib.literals.printBoolean+printBoolean :: Typed.TypedTerm Bool -> Typed.TypedTerm String+printBoolean b =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readUint8")),-      Core.applicationArgument = (Typed.unTypedTerm s)}))+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printBoolean")),+      Core.applicationArgument = (Typed.unTypedTerm b)})) --- | DSL reference to hydra.lib.literals.showBigint-showBigint :: Typed.TypedTerm Integer -> Typed.TypedTerm String-showBigint x =+-- | DSL reference to hydra.lib.literals.printDecimal+printDecimal :: Typed.TypedTerm Sci.Scientific -> Typed.TypedTerm String+printDecimal x =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showBigint")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printDecimal")),       Core.applicationArgument = (Typed.unTypedTerm x)})) --- | DSL reference to hydra.lib.literals.showDecimal-showDecimal :: Typed.TypedTerm Sci.Scientific -> Typed.TypedTerm String-showDecimal x =+-- | DSL reference to hydra.lib.literals.printFloat32+printFloat32 :: Typed.TypedTerm Float -> Typed.TypedTerm String+printFloat32 x =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showDecimal")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printFloat32")),       Core.applicationArgument = (Typed.unTypedTerm x)})) --- | DSL reference to hydra.lib.literals.showFloat32-showFloat32 :: Typed.TypedTerm Float -> Typed.TypedTerm String-showFloat32 x =+-- | DSL reference to hydra.lib.literals.printFloat64+printFloat64 :: Typed.TypedTerm Double -> Typed.TypedTerm String+printFloat64 x =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showFloat32")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printFloat64")),       Core.applicationArgument = (Typed.unTypedTerm x)})) --- | DSL reference to hydra.lib.literals.showFloat64-showFloat64 :: Typed.TypedTerm Double -> Typed.TypedTerm String-showFloat64 x =+-- | DSL reference to hydra.lib.literals.printInt16+printInt16 :: Typed.TypedTerm I.Int16 -> Typed.TypedTerm String+printInt16 x =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showFloat64")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printInt16")),       Core.applicationArgument = (Typed.unTypedTerm x)})) --- | DSL reference to hydra.lib.literals.showInt16-showInt16 :: Typed.TypedTerm I.Int16 -> Typed.TypedTerm String-showInt16 x =+-- | DSL reference to hydra.lib.literals.printInt32+printInt32 :: Typed.TypedTerm Int -> Typed.TypedTerm String+printInt32 x =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showInt16")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printInt32")),       Core.applicationArgument = (Typed.unTypedTerm x)})) --- | DSL reference to hydra.lib.literals.showInt32-showInt32 :: Typed.TypedTerm Int -> Typed.TypedTerm String-showInt32 x =+-- | DSL reference to hydra.lib.literals.printInt64+printInt64 :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm String+printInt64 x =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showInt32")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printInt64")),       Core.applicationArgument = (Typed.unTypedTerm x)})) --- | DSL reference to hydra.lib.literals.showInt64-showInt64 :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm String-showInt64 x =+-- | DSL reference to hydra.lib.literals.printInt8+printInt8 :: Typed.TypedTerm I.Int8 -> Typed.TypedTerm String+printInt8 x =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showInt64")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printInt8")),       Core.applicationArgument = (Typed.unTypedTerm x)})) --- | DSL reference to hydra.lib.literals.showInt8-showInt8 :: Typed.TypedTerm I.Int8 -> Typed.TypedTerm String-showInt8 x =+-- | DSL reference to hydra.lib.literals.printString+printString :: Typed.TypedTerm String -> Typed.TypedTerm String+printString s =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showInt8")),-      Core.applicationArgument = (Typed.unTypedTerm x)}))+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printString")),+      Core.applicationArgument = (Typed.unTypedTerm s)})) --- | DSL reference to hydra.lib.literals.showUint16-showUint16 :: Typed.TypedTerm Int -> Typed.TypedTerm String-showUint16 x =+-- | DSL reference to hydra.lib.literals.printUint16+printUint16 :: Typed.TypedTerm Int -> Typed.TypedTerm String+printUint16 x =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showUint16")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printUint16")),       Core.applicationArgument = (Typed.unTypedTerm x)})) --- | DSL reference to hydra.lib.literals.showUint32-showUint32 :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm String-showUint32 x =+-- | DSL reference to hydra.lib.literals.printUint32+printUint32 :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm String+printUint32 x =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showUint32")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printUint32")),       Core.applicationArgument = (Typed.unTypedTerm x)})) --- | DSL reference to hydra.lib.literals.showUint64-showUint64 :: Typed.TypedTerm Integer -> Typed.TypedTerm String-showUint64 x =+-- | DSL reference to hydra.lib.literals.printUint64+printUint64 :: Typed.TypedTerm Integer -> Typed.TypedTerm String+printUint64 x =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showUint64")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printUint64")),       Core.applicationArgument = (Typed.unTypedTerm x)})) --- | DSL reference to hydra.lib.literals.showUint8-showUint8 :: Typed.TypedTerm I.Int16 -> Typed.TypedTerm String-showUint8 x =+-- | DSL reference to hydra.lib.literals.printUint8+printUint8 :: Typed.TypedTerm I.Int16 -> Typed.TypedTerm String+printUint8 x =     Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showUint8")),+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printUint8")),       Core.applicationArgument = (Typed.unTypedTerm x)}))  -- | DSL reference to hydra.lib.literals.uint16ToBigint
src/main/haskell/Hydra/Dsl/Lib/Logic.hs view
@@ -63,6 +63,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.lib.logic.and and :: Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool
src/main/haskell/Hydra/Dsl/Lib/Maps.hs view
@@ -63,10 +63,11 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | DSL reference to hydra.lib.maps.alter-alter :: Ord k => (Typed.TypedTerm (Maybe v -> Maybe v) -> Typed.TypedTerm k -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v))+alter :: Typed.TypedTerm (Maybe v -> Maybe v) -> Typed.TypedTerm k -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v) alter f k m =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -77,7 +78,7 @@       Core.applicationArgument = (Typed.unTypedTerm m)}))  -- | DSL reference to hydra.lib.maps.bimap-bimap :: (Ord k1, Ord k2) => (Typed.TypedTerm (k1 -> k2) -> Typed.TypedTerm (v1 -> v2) -> Typed.TypedTerm (M.Map k1 v1) -> Typed.TypedTerm (M.Map k2 v2))+bimap :: Typed.TypedTerm (k1 -> k2) -> Typed.TypedTerm (v1 -> v2) -> Typed.TypedTerm (M.Map k1 v1) -> Typed.TypedTerm (M.Map k2 v2) bimap fk fv m =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -88,7 +89,7 @@       Core.applicationArgument = (Typed.unTypedTerm m)}))  -- | DSL reference to hydra.lib.maps.delete-delete :: Ord k => (Typed.TypedTerm k -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v))+delete :: Typed.TypedTerm k -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v) delete k m =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -97,7 +98,7 @@       Core.applicationArgument = (Typed.unTypedTerm m)}))  -- | DSL reference to hydra.lib.maps.difference-difference :: Ord k => (Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v))+difference :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v) difference m1 m2 =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -106,18 +107,18 @@       Core.applicationArgument = (Typed.unTypedTerm m2)}))  -- | DSL reference to hydra.lib.maps.elems-elems :: Ord k => (Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm [v])+elems :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm [v] elems m =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.elems")),       Core.applicationArgument = (Typed.unTypedTerm m)}))  -- | DSL reference to hydra.lib.maps.empty-empty :: Ord k => (Typed.TypedTerm (M.Map k v))+empty :: Typed.TypedTerm (M.Map k v) empty = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.lib.maps.empty"))  -- | DSL reference to hydra.lib.maps.filter-filter :: Ord k => (Typed.TypedTerm (v -> Bool) -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v))+filter :: Typed.TypedTerm (v -> Bool) -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v) filter p m =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -126,7 +127,7 @@       Core.applicationArgument = (Typed.unTypedTerm m)}))  -- | DSL reference to hydra.lib.maps.filterWithKey-filterWithKey :: Ord k => (Typed.TypedTerm (k -> v -> Bool) -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v))+filterWithKey :: Typed.TypedTerm (k -> v -> Bool) -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v) filterWithKey p m =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -135,7 +136,7 @@       Core.applicationArgument = (Typed.unTypedTerm m)}))  -- | DSL reference to hydra.lib.maps.findWithDefault-findWithDefault :: Ord k => (Typed.TypedTerm v -> Typed.TypedTerm k -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm v)+findWithDefault :: Typed.TypedTerm v -> Typed.TypedTerm k -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm v findWithDefault def k m =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -146,14 +147,14 @@       Core.applicationArgument = (Typed.unTypedTerm m)}))  -- | DSL reference to hydra.lib.maps.fromList-fromList :: Ord k => (Typed.TypedTerm [(k, v)] -> Typed.TypedTerm (M.Map k v))+fromList :: Typed.TypedTerm [(k, v)] -> Typed.TypedTerm (M.Map k v) fromList xs =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.fromList")),       Core.applicationArgument = (Typed.unTypedTerm xs)}))  -- | DSL reference to hydra.lib.maps.insert-insert :: Ord k => (Typed.TypedTerm k -> Typed.TypedTerm v -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v))+insert :: Typed.TypedTerm k -> Typed.TypedTerm v -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v) insert k v m =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -164,7 +165,7 @@       Core.applicationArgument = (Typed.unTypedTerm m)}))  -- | DSL reference to hydra.lib.maps.intersection-intersection :: Ord k => (Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v))+intersection :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v) intersection m1 m2 =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -172,15 +173,22 @@         Core.applicationArgument = (Typed.unTypedTerm m1)})),       Core.applicationArgument = (Typed.unTypedTerm m2)})) +-- | DSL reference to hydra.lib.maps.isEmpty+isEmpty :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm Bool+isEmpty m =+    Typed.TypedTerm (Core.TermApplication (Core.Application {+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.isEmpty")),+      Core.applicationArgument = (Typed.unTypedTerm m)}))+ -- | DSL reference to hydra.lib.maps.keys-keys :: Ord k => (Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm [k])+keys :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm [k] keys m =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.keys")),       Core.applicationArgument = (Typed.unTypedTerm m)}))  -- | DSL reference to hydra.lib.maps.lookup-lookup :: Ord k => (Typed.TypedTerm k -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (Maybe v))+lookup :: Typed.TypedTerm k -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (Maybe v) lookup k m =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -189,7 +197,7 @@       Core.applicationArgument = (Typed.unTypedTerm m)}))  -- | DSL reference to hydra.lib.maps.map-map :: Ord k => (Typed.TypedTerm (v1 -> v2) -> Typed.TypedTerm (M.Map k v1) -> Typed.TypedTerm (M.Map k v2))+map :: Typed.TypedTerm (v1 -> v2) -> Typed.TypedTerm (M.Map k v1) -> Typed.TypedTerm (M.Map k v2) map f m =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -198,7 +206,7 @@       Core.applicationArgument = (Typed.unTypedTerm m)}))  -- | DSL reference to hydra.lib.maps.mapKeys-mapKeys :: (Ord k1, Ord k2) => (Typed.TypedTerm (k1 -> k2) -> Typed.TypedTerm (M.Map k1 v) -> Typed.TypedTerm (M.Map k2 v))+mapKeys :: Typed.TypedTerm (k1 -> k2) -> Typed.TypedTerm (M.Map k1 v) -> Typed.TypedTerm (M.Map k2 v) mapKeys f m =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -207,7 +215,7 @@       Core.applicationArgument = (Typed.unTypedTerm m)}))  -- | DSL reference to hydra.lib.maps.member-member :: Ord k => (Typed.TypedTerm k -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm Bool)+member :: Typed.TypedTerm k -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm Bool member k m =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -215,15 +223,8 @@         Core.applicationArgument = (Typed.unTypedTerm k)})),       Core.applicationArgument = (Typed.unTypedTerm m)})) --- | DSL reference to hydra.lib.maps.null-null :: Ord k => (Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm Bool)-null m =-    Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.null")),-      Core.applicationArgument = (Typed.unTypedTerm m)}))- -- | DSL reference to hydra.lib.maps.singleton-singleton :: Ord k => (Typed.TypedTerm k -> Typed.TypedTerm v -> Typed.TypedTerm (M.Map k v))+singleton :: Typed.TypedTerm k -> Typed.TypedTerm v -> Typed.TypedTerm (M.Map k v) singleton k v =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -232,21 +233,21 @@       Core.applicationArgument = (Typed.unTypedTerm v)}))  -- | DSL reference to hydra.lib.maps.size-size :: Ord k => (Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm Int)+size :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm Int size m =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.size")),       Core.applicationArgument = (Typed.unTypedTerm m)}))  -- | DSL reference to hydra.lib.maps.toList-toList :: Ord k => (Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm [(k, v)])+toList :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm [(k, v)] toList m =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.toList")),       Core.applicationArgument = (Typed.unTypedTerm m)}))  -- | DSL reference to hydra.lib.maps.union-union :: Ord k => (Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v))+union :: Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm (M.Map k v) union m1 m2 =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -255,7 +256,7 @@       Core.applicationArgument = (Typed.unTypedTerm m2)}))  -- | DSL reference to hydra.lib.maps.unions-unions :: Ord k => (Typed.TypedTerm [M.Map k v] -> Typed.TypedTerm (M.Map k v))+unions :: Typed.TypedTerm [M.Map k v] -> Typed.TypedTerm (M.Map k v) unions ms =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.unions")),
src/main/haskell/Hydra/Dsl/Lib/Math.hs view
@@ -63,6 +63,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.lib.math.abs abs :: Typed.TypedTerm x -> Typed.TypedTerm x
src/main/haskell/Hydra/Dsl/Lib/Optionals.hs view
@@ -63,6 +63,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Set as S  -- | DSL reference to hydra.lib.optionals.apply@@ -105,6 +106,13 @@         Core.applicationArgument = (Typed.unTypedTerm acc)})),       Core.applicationArgument = (Typed.unTypedTerm xs)})) +-- | DSL reference to hydra.lib.optionals.given+given :: Typed.TypedTerm x -> Typed.TypedTerm (Maybe x)+given x =+    Typed.TypedTerm (Core.TermApplication (Core.Application {+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.given")),+      Core.applicationArgument = (Typed.unTypedTerm x)}))+ -- | DSL reference to hydra.lib.optionals.givens givens :: Typed.TypedTerm [Maybe x] -> Typed.TypedTerm [x] givens xs =@@ -154,7 +162,7 @@       Core.applicationArgument = (Typed.unTypedTerm xs)}))  -- | DSL reference to hydra.lib.optionals.mapSet-mapSet :: (Ord x, Ord y) => (Typed.TypedTerm (x -> Maybe y) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (Maybe (S.Set y)))+mapSet :: Typed.TypedTerm (x -> Maybe y) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (Maybe (S.Set y)) mapSet f s =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -172,13 +180,6 @@           Core.applicationArgument = (Typed.unTypedTerm m)})),         Core.applicationArgument = (Typed.unTypedTerm def)})),       Core.applicationArgument = (Typed.unTypedTerm f)}))---- | DSL reference to hydra.lib.optionals.pure-pure :: Typed.TypedTerm x -> Typed.TypedTerm (Maybe x)-pure x =-    Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.pure")),-      Core.applicationArgument = (Typed.unTypedTerm x)}))  -- | DSL reference to hydra.lib.optionals.toList toList :: Typed.TypedTerm (Maybe x) -> Typed.TypedTerm [x]
src/main/haskell/Hydra/Dsl/Lib/Ordering.hs view
@@ -63,6 +63,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.lib.ordering.compare compare :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Util.Comparison
src/main/haskell/Hydra/Dsl/Lib/Pairs.hs view
@@ -63,6 +63,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.lib.pairs.bimap bimap :: Typed.TypedTerm (a -> c) -> Typed.TypedTerm (b -> d) -> Typed.TypedTerm (a, b) -> Typed.TypedTerm (c, d)@@ -81,6 +82,15 @@     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.pairs.first")),       Core.applicationArgument = (Typed.unTypedTerm p)}))++-- | DSL reference to hydra.lib.pairs.pair+pair :: Typed.TypedTerm a -> Typed.TypedTerm b -> Typed.TypedTerm (a, b)+pair x y =+    Typed.TypedTerm (Core.TermApplication (Core.Application {+      Core.applicationFunction = (Core.TermApplication (Core.Application {+        Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.pairs.pair")),+        Core.applicationArgument = (Typed.unTypedTerm x)})),+      Core.applicationArgument = (Typed.unTypedTerm y)}))  -- | DSL reference to hydra.lib.pairs.second second :: Typed.TypedTerm (a, b) -> Typed.TypedTerm b
src/main/haskell/Hydra/Dsl/Lib/Regex.hs view
@@ -63,6 +63,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.lib.regex.find find :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm (Maybe String)
src/main/haskell/Hydra/Dsl/Lib/Sets.hs view
@@ -63,10 +63,11 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Set as S  -- | DSL reference to hydra.lib.sets.delete-delete :: Ord x => (Typed.TypedTerm x -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x))+delete :: Typed.TypedTerm x -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x) delete x s =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -75,7 +76,7 @@       Core.applicationArgument = (Typed.unTypedTerm s)}))  -- | DSL reference to hydra.lib.sets.difference-difference :: Ord x => (Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x))+difference :: Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x) difference s1 s2 =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -84,11 +85,11 @@       Core.applicationArgument = (Typed.unTypedTerm s2)}))  -- | DSL reference to hydra.lib.sets.empty-empty :: Ord x => (Typed.TypedTerm (S.Set x))+empty :: Typed.TypedTerm (S.Set x) empty = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.lib.sets.empty"))  -- | DSL reference to hydra.lib.sets.filter-filter :: Ord x => (Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x))+filter :: Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x) filter predicate s =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -97,14 +98,14 @@       Core.applicationArgument = (Typed.unTypedTerm s)}))  -- | DSL reference to hydra.lib.sets.fromList-fromList :: Ord x => (Typed.TypedTerm [x] -> Typed.TypedTerm (S.Set x))+fromList :: Typed.TypedTerm [x] -> Typed.TypedTerm (S.Set x) fromList xs =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.fromList")),       Core.applicationArgument = (Typed.unTypedTerm xs)}))  -- | DSL reference to hydra.lib.sets.insert-insert :: Ord x => (Typed.TypedTerm x -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x))+insert :: Typed.TypedTerm x -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x) insert x s =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -113,7 +114,7 @@       Core.applicationArgument = (Typed.unTypedTerm s)}))  -- | DSL reference to hydra.lib.sets.intersection-intersection :: Ord x => (Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x))+intersection :: Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x) intersection s1 s2 =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -121,8 +122,15 @@         Core.applicationArgument = (Typed.unTypedTerm s1)})),       Core.applicationArgument = (Typed.unTypedTerm s2)})) +-- | DSL reference to hydra.lib.sets.isEmpty+isEmpty :: Typed.TypedTerm (S.Set x) -> Typed.TypedTerm Bool+isEmpty s =+    Typed.TypedTerm (Core.TermApplication (Core.Application {+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.isEmpty")),+      Core.applicationArgument = (Typed.unTypedTerm s)}))+ -- | DSL reference to hydra.lib.sets.map-map :: (Ord x, Ord y) => (Typed.TypedTerm (x -> y) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set y))+map :: Typed.TypedTerm (x -> y) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set y) map f s =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -131,7 +139,7 @@       Core.applicationArgument = (Typed.unTypedTerm s)}))  -- | DSL reference to hydra.lib.sets.member-member :: Ord x => (Typed.TypedTerm x -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm Bool)+member :: Typed.TypedTerm x -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm Bool member x s =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -139,36 +147,29 @@         Core.applicationArgument = (Typed.unTypedTerm x)})),       Core.applicationArgument = (Typed.unTypedTerm s)})) --- | DSL reference to hydra.lib.sets.null-null :: Ord x => (Typed.TypedTerm (S.Set x) -> Typed.TypedTerm Bool)-null s =-    Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.null")),-      Core.applicationArgument = (Typed.unTypedTerm s)}))- -- | DSL reference to hydra.lib.sets.singleton-singleton :: Ord x => (Typed.TypedTerm x -> Typed.TypedTerm (S.Set x))+singleton :: Typed.TypedTerm x -> Typed.TypedTerm (S.Set x) singleton x =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.singleton")),       Core.applicationArgument = (Typed.unTypedTerm x)}))  -- | DSL reference to hydra.lib.sets.size-size :: Ord x => (Typed.TypedTerm (S.Set x) -> Typed.TypedTerm Int)+size :: Typed.TypedTerm (S.Set x) -> Typed.TypedTerm Int size s =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.size")),       Core.applicationArgument = (Typed.unTypedTerm s)}))  -- | DSL reference to hydra.lib.sets.toList-toList :: Ord x => (Typed.TypedTerm (S.Set x) -> Typed.TypedTerm [x])+toList :: Typed.TypedTerm (S.Set x) -> Typed.TypedTerm [x] toList s =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.toList")),       Core.applicationArgument = (Typed.unTypedTerm s)}))  -- | DSL reference to hydra.lib.sets.union-union :: Ord x => (Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x))+union :: Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x) union s1 s2 =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -177,7 +178,7 @@       Core.applicationArgument = (Typed.unTypedTerm s2)}))  -- | DSL reference to hydra.lib.sets.unions-unions :: Ord x => (Typed.TypedTerm [S.Set x] -> Typed.TypedTerm (S.Set x))+unions :: Typed.TypedTerm [S.Set x] -> Typed.TypedTerm (S.Set x) unions ss =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.unions")),
src/main/haskell/Hydra/Dsl/Lib/Strings.hs view
@@ -63,6 +63,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.lib.strings.charAt charAt :: Typed.TypedTerm Int -> Typed.TypedTerm String -> Typed.TypedTerm (Maybe Int)@@ -96,6 +97,13 @@       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.fromList")),       Core.applicationArgument = (Typed.unTypedTerm cs)})) +-- | DSL reference to hydra.lib.strings.isEmpty+isEmpty :: Typed.TypedTerm String -> Typed.TypedTerm Bool+isEmpty s =+    Typed.TypedTerm (Core.TermApplication (Core.Application {+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.isEmpty")),+      Core.applicationArgument = (Typed.unTypedTerm s)}))+ -- | DSL reference to hydra.lib.strings.join join :: Typed.TypedTerm String -> Typed.TypedTerm [String] -> Typed.TypedTerm String join sep xs =@@ -110,13 +118,6 @@ length s =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.length")),-      Core.applicationArgument = (Typed.unTypedTerm s)}))---- | DSL reference to hydra.lib.strings.null-null :: Typed.TypedTerm String -> Typed.TypedTerm Bool-null s =-    Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.null")),       Core.applicationArgument = (Typed.unTypedTerm s)}))  -- | DSL reference to hydra.lib.strings.splitOn
src/main/haskell/Hydra/Dsl/Lib/System.hs view
@@ -63,6 +63,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.ByteString as B import qualified Data.Map as M 
src/main/haskell/Hydra/Dsl/Lib/Text.hs view
@@ -63,6 +63,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.ByteString as B  -- | DSL reference to hydra.lib.text.decodeUtf8
src/main/haskell/Hydra/Dsl/Names.hs view
@@ -70,6 +70,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S 
src/main/haskell/Hydra/Dsl/Packaging.hs view
@@ -14,6 +14,7 @@ import qualified Hydra.Typing as Typing import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL name token for hydra.packaging.Definition definitionDefinition :: Typed.TypedName Packaging.Definition
src/main/haskell/Hydra/Dsl/Parsing.hs view
@@ -14,6 +14,7 @@ import qualified Hydra.Typed as Typed import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL composition builder for the decoder of hydra.parsing.ParseResult decodeParseResult :: Typed.TypedTerm (Graph.Graph -> Core.Term -> Either Errors.DecodingError a) -> Typed.TypedTerm (Graph.Graph -> Core.Term -> Either Errors.DecodingError (Parsing.ParseResult a))
src/main/haskell/Hydra/Dsl/Paths.hs view
@@ -12,17 +12,84 @@ import qualified Hydra.Typed as Typed import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void +-- | DSL constructor for hydra.paths.SubtermAttribute+subtermAttribute :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Paths.TermAttribute -> Typed.TypedTerm Paths.SubtermAttribute+subtermAttribute path target =+    Typed.TypedTerm (Core.TermRecord (Core.Record {+      Core.recordTypeName = (Core.Name "hydra.paths.SubtermAttribute"),+      Core.recordFields = [+        Core.Field {+          Core.fieldName = (Core.Name "path"),+          Core.fieldTerm = (Typed.unTypedTerm path)},+        Core.Field {+          Core.fieldName = (Core.Name "target"),+          Core.fieldTerm = (Typed.unTypedTerm target)}]}))++-- | DSL accessor for the path field of hydra.paths.SubtermAttribute+subtermAttributePath :: Typed.TypedTerm Paths.SubtermAttribute -> Typed.TypedTerm Paths.SubtermPath+subtermAttributePath x =+    Typed.TypedTerm (Core.TermApplication (Core.Application {+      Core.applicationFunction = (Core.TermProject (Core.Projection {+        Core.projectionTypeName = (Core.Name "hydra.paths.SubtermAttribute"),+        Core.projectionFieldName = (Core.Name "path")})),+      Core.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.paths.SubtermAttribute+subtermAttributeSubtermAttribute :: Typed.TypedName Paths.SubtermAttribute+subtermAttributeSubtermAttribute = Typed.TypedName (Core.Name "hydra.paths.SubtermAttribute")++-- | DSL accessor for the target field of hydra.paths.SubtermAttribute+subtermAttributeTarget :: Typed.TypedTerm Paths.SubtermAttribute -> Typed.TypedTerm Paths.TermAttribute+subtermAttributeTarget x =+    Typed.TypedTerm (Core.TermApplication (Core.Application {+      Core.applicationFunction = (Core.TermProject (Core.Projection {+        Core.projectionTypeName = (Core.Name "hydra.paths.SubtermAttribute"),+        Core.projectionFieldName = (Core.Name "target")})),+      Core.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the path field of hydra.paths.SubtermAttribute+subtermAttributeWithPath :: Typed.TypedTerm Paths.SubtermAttribute -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Paths.SubtermAttribute+subtermAttributeWithPath original newVal =+    Typed.TypedTerm (Core.TermRecord (Core.Record {+      Core.recordTypeName = (Core.Name "hydra.paths.SubtermAttribute"),+      Core.recordFields = [+        Core.Field {+          Core.fieldName = (Core.Name "path"),+          Core.fieldTerm = (Typed.unTypedTerm newVal)},+        Core.Field {+          Core.fieldName = (Core.Name "target"),+          Core.fieldTerm = (Core.TermApplication (Core.Application {+            Core.applicationFunction = (Core.TermProject (Core.Projection {+              Core.projectionTypeName = (Core.Name "hydra.paths.SubtermAttribute"),+              Core.projectionFieldName = (Core.Name "target")})),+            Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the target field of hydra.paths.SubtermAttribute+subtermAttributeWithTarget :: Typed.TypedTerm Paths.SubtermAttribute -> Typed.TypedTerm Paths.TermAttribute -> Typed.TypedTerm Paths.SubtermAttribute+subtermAttributeWithTarget original newVal =+    Typed.TypedTerm (Core.TermRecord (Core.Record {+      Core.recordTypeName = (Core.Name "hydra.paths.SubtermAttribute"),+      Core.recordFields = [+        Core.Field {+          Core.fieldName = (Core.Name "path"),+          Core.fieldTerm = (Core.TermApplication (Core.Application {+            Core.applicationFunction = (Core.TermProject (Core.Projection {+              Core.projectionTypeName = (Core.Name "hydra.paths.SubtermAttribute"),+              Core.projectionFieldName = (Core.Name "path")})),+            Core.applicationArgument = (Typed.unTypedTerm original)}))},+        Core.Field {+          Core.fieldName = (Core.Name "target"),+          Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))+ -- | DSL constructor for hydra.paths.SubtermEdge-subtermEdge :: Typed.TypedTerm Paths.SubtermNode -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Paths.SubtermNode -> Typed.TypedTerm Paths.SubtermEdge-subtermEdge source path target =+subtermEdge :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Paths.SubtermEdge+subtermEdge path target =     Typed.TypedTerm (Core.TermRecord (Core.Record {       Core.recordTypeName = (Core.Name "hydra.paths.SubtermEdge"),       Core.recordFields = [         Core.Field {-          Core.fieldName = (Core.Name "source"),-          Core.fieldTerm = (Typed.unTypedTerm source)},-        Core.Field {           Core.fieldName = (Core.Name "path"),           Core.fieldTerm = (Typed.unTypedTerm path)},         Core.Field {@@ -38,21 +105,12 @@         Core.projectionFieldName = (Core.Name "path")})),       Core.applicationArgument = (Typed.unTypedTerm x)})) --- | DSL accessor for the source field of hydra.paths.SubtermEdge-subtermEdgeSource :: Typed.TypedTerm Paths.SubtermEdge -> Typed.TypedTerm Paths.SubtermNode-subtermEdgeSource x =-    Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermProject (Core.Projection {-        Core.projectionTypeName = (Core.Name "hydra.paths.SubtermEdge"),-        Core.projectionFieldName = (Core.Name "source")})),-      Core.applicationArgument = (Typed.unTypedTerm x)}))- -- | DSL name token for hydra.paths.SubtermEdge subtermEdgeSubtermEdge :: Typed.TypedName Paths.SubtermEdge subtermEdgeSubtermEdge = Typed.TypedName (Core.Name "hydra.paths.SubtermEdge")  -- | DSL accessor for the target field of hydra.paths.SubtermEdge-subtermEdgeTarget :: Typed.TypedTerm Paths.SubtermEdge -> Typed.TypedTerm Paths.SubtermNode+subtermEdgeTarget :: Typed.TypedTerm Paths.SubtermEdge -> Typed.TypedTerm Core.Name subtermEdgeTarget x =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermProject (Core.Projection {@@ -67,13 +125,6 @@       Core.recordTypeName = (Core.Name "hydra.paths.SubtermEdge"),       Core.recordFields = [         Core.Field {-          Core.fieldName = (Core.Name "source"),-          Core.fieldTerm = (Core.TermApplication (Core.Application {-            Core.applicationFunction = (Core.TermProject (Core.Projection {-              Core.projectionTypeName = (Core.Name "hydra.paths.SubtermEdge"),-              Core.projectionFieldName = (Core.Name "source")})),-            Core.applicationArgument = (Typed.unTypedTerm original)}))},-        Core.Field {           Core.fieldName = (Core.Name "path"),           Core.fieldTerm = (Typed.unTypedTerm newVal)},         Core.Field {@@ -84,44 +135,13 @@               Core.projectionFieldName = (Core.Name "target")})),             Core.applicationArgument = (Typed.unTypedTerm original)}))}]})) --- | DSL updater for the source field of hydra.paths.SubtermEdge-subtermEdgeWithSource :: Typed.TypedTerm Paths.SubtermEdge -> Typed.TypedTerm Paths.SubtermNode -> Typed.TypedTerm Paths.SubtermEdge-subtermEdgeWithSource original newVal =-    Typed.TypedTerm (Core.TermRecord (Core.Record {-      Core.recordTypeName = (Core.Name "hydra.paths.SubtermEdge"),-      Core.recordFields = [-        Core.Field {-          Core.fieldName = (Core.Name "source"),-          Core.fieldTerm = (Typed.unTypedTerm newVal)},-        Core.Field {-          Core.fieldName = (Core.Name "path"),-          Core.fieldTerm = (Core.TermApplication (Core.Application {-            Core.applicationFunction = (Core.TermProject (Core.Projection {-              Core.projectionTypeName = (Core.Name "hydra.paths.SubtermEdge"),-              Core.projectionFieldName = (Core.Name "path")})),-            Core.applicationArgument = (Typed.unTypedTerm original)}))},-        Core.Field {-          Core.fieldName = (Core.Name "target"),-          Core.fieldTerm = (Core.TermApplication (Core.Application {-            Core.applicationFunction = (Core.TermProject (Core.Projection {-              Core.projectionTypeName = (Core.Name "hydra.paths.SubtermEdge"),-              Core.projectionFieldName = (Core.Name "target")})),-            Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))- -- | DSL updater for the target field of hydra.paths.SubtermEdge-subtermEdgeWithTarget :: Typed.TypedTerm Paths.SubtermEdge -> Typed.TypedTerm Paths.SubtermNode -> Typed.TypedTerm Paths.SubtermEdge+subtermEdgeWithTarget :: Typed.TypedTerm Paths.SubtermEdge -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Paths.SubtermEdge subtermEdgeWithTarget original newVal =     Typed.TypedTerm (Core.TermRecord (Core.Record {       Core.recordTypeName = (Core.Name "hydra.paths.SubtermEdge"),       Core.recordFields = [         Core.Field {-          Core.fieldName = (Core.Name "source"),-          Core.fieldTerm = (Core.TermApplication (Core.Application {-            Core.applicationFunction = (Core.TermProject (Core.Projection {-              Core.projectionTypeName = (Core.Name "hydra.paths.SubtermEdge"),-              Core.projectionFieldName = (Core.Name "source")})),-            Core.applicationArgument = (Typed.unTypedTerm original)}))},-        Core.Field {           Core.fieldName = (Core.Name "path"),           Core.fieldTerm = (Core.TermApplication (Core.Application {             Core.applicationFunction = (Core.TermProject (Core.Projection {@@ -133,26 +153,14 @@           Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))  -- | DSL constructor for hydra.paths.SubtermGraph-subtermGraph :: Typed.TypedTerm [Paths.SubtermNode] -> Typed.TypedTerm [Paths.SubtermEdge] -> Typed.TypedTerm Paths.SubtermGraph-subtermGraph nodes edges =+subtermGraph :: Typed.TypedTerm [Paths.SubtermNode] -> Typed.TypedTerm Paths.SubtermGraph+subtermGraph nodes =     Typed.TypedTerm (Core.TermRecord (Core.Record {       Core.recordTypeName = (Core.Name "hydra.paths.SubtermGraph"),       Core.recordFields = [         Core.Field {           Core.fieldName = (Core.Name "nodes"),-          Core.fieldTerm = (Typed.unTypedTerm nodes)},-        Core.Field {-          Core.fieldName = (Core.Name "edges"),-          Core.fieldTerm = (Typed.unTypedTerm edges)}]}))---- | DSL accessor for the edges field of hydra.paths.SubtermGraph-subtermGraphEdges :: Typed.TypedTerm Paths.SubtermGraph -> Typed.TypedTerm [Paths.SubtermEdge]-subtermGraphEdges x =-    Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermProject (Core.Projection {-        Core.projectionTypeName = (Core.Name "hydra.paths.SubtermGraph"),-        Core.projectionFieldName = (Core.Name "edges")})),-      Core.applicationArgument = (Typed.unTypedTerm x)}))+          Core.fieldTerm = (Typed.unTypedTerm nodes)}]}))  -- | DSL accessor for the nodes field of hydra.paths.SubtermGraph subtermGraphNodes :: Typed.TypedTerm Paths.SubtermGraph -> Typed.TypedTerm [Paths.SubtermNode]@@ -167,23 +175,6 @@ subtermGraphSubtermGraph :: Typed.TypedName Paths.SubtermGraph subtermGraphSubtermGraph = Typed.TypedName (Core.Name "hydra.paths.SubtermGraph") --- | DSL updater for the edges field of hydra.paths.SubtermGraph-subtermGraphWithEdges :: Typed.TypedTerm Paths.SubtermGraph -> Typed.TypedTerm [Paths.SubtermEdge] -> Typed.TypedTerm Paths.SubtermGraph-subtermGraphWithEdges original newVal =-    Typed.TypedTerm (Core.TermRecord (Core.Record {-      Core.recordTypeName = (Core.Name "hydra.paths.SubtermGraph"),-      Core.recordFields = [-        Core.Field {-          Core.fieldName = (Core.Name "nodes"),-          Core.fieldTerm = (Core.TermApplication (Core.Application {-            Core.applicationFunction = (Core.TermProject (Core.Projection {-              Core.projectionTypeName = (Core.Name "hydra.paths.SubtermGraph"),-              Core.projectionFieldName = (Core.Name "nodes")})),-            Core.applicationArgument = (Typed.unTypedTerm original)}))},-        Core.Field {-          Core.fieldName = (Core.Name "edges"),-          Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))- -- | DSL updater for the nodes field of hydra.paths.SubtermGraph subtermGraphWithNodes :: Typed.TypedTerm Paths.SubtermGraph -> Typed.TypedTerm [Paths.SubtermNode] -> Typed.TypedTerm Paths.SubtermGraph subtermGraphWithNodes original newVal =@@ -192,18 +183,42 @@       Core.recordFields = [         Core.Field {           Core.fieldName = (Core.Name "nodes"),-          Core.fieldTerm = (Typed.unTypedTerm newVal)},-        Core.Field {-          Core.fieldName = (Core.Name "edges"),-          Core.fieldTerm = (Core.TermApplication (Core.Application {-            Core.applicationFunction = (Core.TermProject (Core.Projection {-              Core.projectionTypeName = (Core.Name "hydra.paths.SubtermGraph"),-              Core.projectionFieldName = (Core.Name "edges")})),-            Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))+          Core.fieldTerm = (Typed.unTypedTerm newVal)}]})) +-- | DSL injection for the attribute variant of hydra.paths.SubtermLink+subtermLinkAttribute :: Typed.TypedTerm Paths.SubtermAttribute -> Typed.TypedTerm Paths.SubtermLink+subtermLinkAttribute x =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.SubtermLink"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "attribute"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the edge variant of hydra.paths.SubtermLink+subtermLinkEdge :: Typed.TypedTerm Paths.SubtermEdge -> Typed.TypedTerm Paths.SubtermLink+subtermLinkEdge x =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.SubtermLink"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "edge"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the property variant of hydra.paths.SubtermLink+subtermLinkProperty :: Typed.TypedTerm Paths.SubtermProperty -> Typed.TypedTerm Paths.SubtermLink+subtermLinkProperty x =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.SubtermLink"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "property"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.paths.SubtermLink+subtermLinkSubtermLink :: Typed.TypedName Paths.SubtermLink+subtermLinkSubtermLink = Typed.TypedName (Core.Name "hydra.paths.SubtermLink")+ -- | DSL constructor for hydra.paths.SubtermNode-subtermNode :: Typed.TypedTerm Core.Name -> Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm Paths.SubtermNode-subtermNode name label id =+subtermNode :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.TypeScheme -> Typed.TypedTerm [Paths.SubtermLink] -> Typed.TypedTerm Paths.SubtermNode+subtermNode name type_ links =     Typed.TypedTerm (Core.TermRecord (Core.Record {       Core.recordTypeName = (Core.Name "hydra.paths.SubtermNode"),       Core.recordFields = [@@ -211,28 +226,19 @@           Core.fieldName = (Core.Name "name"),           Core.fieldTerm = (Typed.unTypedTerm name)},         Core.Field {-          Core.fieldName = (Core.Name "label"),-          Core.fieldTerm = (Typed.unTypedTerm label)},+          Core.fieldName = (Core.Name "type"),+          Core.fieldTerm = (Typed.unTypedTerm type_)},         Core.Field {-          Core.fieldName = (Core.Name "id"),-          Core.fieldTerm = (Typed.unTypedTerm id)}]}))---- | DSL accessor for the id field of hydra.paths.SubtermNode-subtermNodeId :: Typed.TypedTerm Paths.SubtermNode -> Typed.TypedTerm String-subtermNodeId x =-    Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermProject (Core.Projection {-        Core.projectionTypeName = (Core.Name "hydra.paths.SubtermNode"),-        Core.projectionFieldName = (Core.Name "id")})),-      Core.applicationArgument = (Typed.unTypedTerm x)}))+          Core.fieldName = (Core.Name "links"),+          Core.fieldTerm = (Typed.unTypedTerm links)}]})) --- | DSL accessor for the label field of hydra.paths.SubtermNode-subtermNodeLabel :: Typed.TypedTerm Paths.SubtermNode -> Typed.TypedTerm String-subtermNodeLabel x =+-- | DSL accessor for the links field of hydra.paths.SubtermNode+subtermNodeLinks :: Typed.TypedTerm Paths.SubtermNode -> Typed.TypedTerm [Paths.SubtermLink]+subtermNodeLinks x =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermProject (Core.Projection {         Core.projectionTypeName = (Core.Name "hydra.paths.SubtermNode"),-        Core.projectionFieldName = (Core.Name "label")})),+        Core.projectionFieldName = (Core.Name "links")})),       Core.applicationArgument = (Typed.unTypedTerm x)}))  -- | DSL accessor for the name field of hydra.paths.SubtermNode@@ -248,9 +254,18 @@ subtermNodeSubtermNode :: Typed.TypedName Paths.SubtermNode subtermNodeSubtermNode = Typed.TypedName (Core.Name "hydra.paths.SubtermNode") --- | DSL updater for the id field of hydra.paths.SubtermNode-subtermNodeWithId :: Typed.TypedTerm Paths.SubtermNode -> Typed.TypedTerm String -> Typed.TypedTerm Paths.SubtermNode-subtermNodeWithId original newVal =+-- | DSL accessor for the type field of hydra.paths.SubtermNode+subtermNodeType :: Typed.TypedTerm Paths.SubtermNode -> Typed.TypedTerm Core.TypeScheme+subtermNodeType x =+    Typed.TypedTerm (Core.TermApplication (Core.Application {+      Core.applicationFunction = (Core.TermProject (Core.Projection {+        Core.projectionTypeName = (Core.Name "hydra.paths.SubtermNode"),+        Core.projectionFieldName = (Core.Name "type")})),+      Core.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the links field of hydra.paths.SubtermNode+subtermNodeWithLinks :: Typed.TypedTerm Paths.SubtermNode -> Typed.TypedTerm [Paths.SubtermLink] -> Typed.TypedTerm Paths.SubtermNode+subtermNodeWithLinks original newVal =     Typed.TypedTerm (Core.TermRecord (Core.Record {       Core.recordTypeName = (Core.Name "hydra.paths.SubtermNode"),       Core.recordFields = [@@ -262,62 +277,62 @@               Core.projectionFieldName = (Core.Name "name")})),             Core.applicationArgument = (Typed.unTypedTerm original)}))},         Core.Field {-          Core.fieldName = (Core.Name "label"),+          Core.fieldName = (Core.Name "type"),           Core.fieldTerm = (Core.TermApplication (Core.Application {             Core.applicationFunction = (Core.TermProject (Core.Projection {               Core.projectionTypeName = (Core.Name "hydra.paths.SubtermNode"),-              Core.projectionFieldName = (Core.Name "label")})),+              Core.projectionFieldName = (Core.Name "type")})),             Core.applicationArgument = (Typed.unTypedTerm original)}))},         Core.Field {-          Core.fieldName = (Core.Name "id"),+          Core.fieldName = (Core.Name "links"),           Core.fieldTerm = (Typed.unTypedTerm newVal)}]})) --- | DSL updater for the label field of hydra.paths.SubtermNode-subtermNodeWithLabel :: Typed.TypedTerm Paths.SubtermNode -> Typed.TypedTerm String -> Typed.TypedTerm Paths.SubtermNode-subtermNodeWithLabel original newVal =+-- | DSL updater for the name field of hydra.paths.SubtermNode+subtermNodeWithName :: Typed.TypedTerm Paths.SubtermNode -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Paths.SubtermNode+subtermNodeWithName original newVal =     Typed.TypedTerm (Core.TermRecord (Core.Record {       Core.recordTypeName = (Core.Name "hydra.paths.SubtermNode"),       Core.recordFields = [         Core.Field {           Core.fieldName = (Core.Name "name"),+          Core.fieldTerm = (Typed.unTypedTerm newVal)},+        Core.Field {+          Core.fieldName = (Core.Name "type"),           Core.fieldTerm = (Core.TermApplication (Core.Application {             Core.applicationFunction = (Core.TermProject (Core.Projection {               Core.projectionTypeName = (Core.Name "hydra.paths.SubtermNode"),-              Core.projectionFieldName = (Core.Name "name")})),+              Core.projectionFieldName = (Core.Name "type")})),             Core.applicationArgument = (Typed.unTypedTerm original)}))},         Core.Field {-          Core.fieldName = (Core.Name "label"),-          Core.fieldTerm = (Typed.unTypedTerm newVal)},-        Core.Field {-          Core.fieldName = (Core.Name "id"),+          Core.fieldName = (Core.Name "links"),           Core.fieldTerm = (Core.TermApplication (Core.Application {             Core.applicationFunction = (Core.TermProject (Core.Projection {               Core.projectionTypeName = (Core.Name "hydra.paths.SubtermNode"),-              Core.projectionFieldName = (Core.Name "id")})),+              Core.projectionFieldName = (Core.Name "links")})),             Core.applicationArgument = (Typed.unTypedTerm original)}))}]})) --- | DSL updater for the name field of hydra.paths.SubtermNode-subtermNodeWithName :: Typed.TypedTerm Paths.SubtermNode -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Paths.SubtermNode-subtermNodeWithName original newVal =+-- | DSL updater for the type field of hydra.paths.SubtermNode+subtermNodeWithType :: Typed.TypedTerm Paths.SubtermNode -> Typed.TypedTerm Core.TypeScheme -> Typed.TypedTerm Paths.SubtermNode+subtermNodeWithType original newVal =     Typed.TypedTerm (Core.TermRecord (Core.Record {       Core.recordTypeName = (Core.Name "hydra.paths.SubtermNode"),       Core.recordFields = [         Core.Field {           Core.fieldName = (Core.Name "name"),-          Core.fieldTerm = (Typed.unTypedTerm newVal)},-        Core.Field {-          Core.fieldName = (Core.Name "label"),           Core.fieldTerm = (Core.TermApplication (Core.Application {             Core.applicationFunction = (Core.TermProject (Core.Projection {               Core.projectionTypeName = (Core.Name "hydra.paths.SubtermNode"),-              Core.projectionFieldName = (Core.Name "label")})),+              Core.projectionFieldName = (Core.Name "name")})),             Core.applicationArgument = (Typed.unTypedTerm original)}))},         Core.Field {-          Core.fieldName = (Core.Name "id"),+          Core.fieldName = (Core.Name "type"),+          Core.fieldTerm = (Typed.unTypedTerm newVal)},+        Core.Field {+          Core.fieldName = (Core.Name "links"),           Core.fieldTerm = (Core.TermApplication (Core.Application {             Core.applicationFunction = (Core.TermProject (Core.Projection {               Core.projectionTypeName = (Core.Name "hydra.paths.SubtermNode"),-              Core.projectionFieldName = (Core.Name "id")})),+              Core.projectionFieldName = (Core.Name "links")})),             Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))  -- | DSL constructor for the hydra.paths.SubtermPath wrapper@@ -331,6 +346,84 @@ subtermPathSubtermPath :: Typed.TypedName Paths.SubtermPath subtermPathSubtermPath = Typed.TypedName (Core.Name "hydra.paths.SubtermPath") +-- | DSL constructor for hydra.paths.SubtermProperty+subtermProperty :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Paths.SubtermProperty+subtermProperty path target =+    Typed.TypedTerm (Core.TermRecord (Core.Record {+      Core.recordTypeName = (Core.Name "hydra.paths.SubtermProperty"),+      Core.recordFields = [+        Core.Field {+          Core.fieldName = (Core.Name "path"),+          Core.fieldTerm = (Typed.unTypedTerm path)},+        Core.Field {+          Core.fieldName = (Core.Name "target"),+          Core.fieldTerm = (Typed.unTypedTerm target)}]}))++-- | DSL accessor for the path field of hydra.paths.SubtermProperty+subtermPropertyPath :: Typed.TypedTerm Paths.SubtermProperty -> Typed.TypedTerm Paths.SubtermPath+subtermPropertyPath x =+    Typed.TypedTerm (Core.TermApplication (Core.Application {+      Core.applicationFunction = (Core.TermProject (Core.Projection {+        Core.projectionTypeName = (Core.Name "hydra.paths.SubtermProperty"),+        Core.projectionFieldName = (Core.Name "path")})),+      Core.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.paths.SubtermProperty+subtermPropertySubtermProperty :: Typed.TypedName Paths.SubtermProperty+subtermPropertySubtermProperty = Typed.TypedName (Core.Name "hydra.paths.SubtermProperty")++-- | DSL accessor for the target field of hydra.paths.SubtermProperty+subtermPropertyTarget :: Typed.TypedTerm Paths.SubtermProperty -> Typed.TypedTerm Core.Term+subtermPropertyTarget x =+    Typed.TypedTerm (Core.TermApplication (Core.Application {+      Core.applicationFunction = (Core.TermProject (Core.Projection {+        Core.projectionTypeName = (Core.Name "hydra.paths.SubtermProperty"),+        Core.projectionFieldName = (Core.Name "target")})),+      Core.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the path field of hydra.paths.SubtermProperty+subtermPropertyWithPath :: Typed.TypedTerm Paths.SubtermProperty -> Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm Paths.SubtermProperty+subtermPropertyWithPath original newVal =+    Typed.TypedTerm (Core.TermRecord (Core.Record {+      Core.recordTypeName = (Core.Name "hydra.paths.SubtermProperty"),+      Core.recordFields = [+        Core.Field {+          Core.fieldName = (Core.Name "path"),+          Core.fieldTerm = (Typed.unTypedTerm newVal)},+        Core.Field {+          Core.fieldName = (Core.Name "target"),+          Core.fieldTerm = (Core.TermApplication (Core.Application {+            Core.applicationFunction = (Core.TermProject (Core.Projection {+              Core.projectionTypeName = (Core.Name "hydra.paths.SubtermProperty"),+              Core.projectionFieldName = (Core.Name "target")})),+            Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the target field of hydra.paths.SubtermProperty+subtermPropertyWithTarget :: Typed.TypedTerm Paths.SubtermProperty -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Paths.SubtermProperty+subtermPropertyWithTarget original newVal =+    Typed.TypedTerm (Core.TermRecord (Core.Record {+      Core.recordTypeName = (Core.Name "hydra.paths.SubtermProperty"),+      Core.recordFields = [+        Core.Field {+          Core.fieldName = (Core.Name "path"),+          Core.fieldTerm = (Core.TermApplication (Core.Application {+            Core.applicationFunction = (Core.TermProject (Core.Projection {+              Core.projectionTypeName = (Core.Name "hydra.paths.SubtermProperty"),+              Core.projectionFieldName = (Core.Name "path")})),+            Core.applicationArgument = (Typed.unTypedTerm original)}))},+        Core.Field {+          Core.fieldName = (Core.Name "target"),+          Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))++-- | DSL injection for the annotatedAnnotation variant of hydra.paths.SubtermStep+subtermStepAnnotatedAnnotation :: Typed.TypedTerm Paths.SubtermStep+subtermStepAnnotatedAnnotation =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "annotatedAnnotation"),+        Core.fieldTerm = Core.TermUnit}}))+ -- | DSL injection for the annotatedBody variant of hydra.paths.SubtermStep subtermStepAnnotatedBody :: Typed.TypedTerm Paths.SubtermStep subtermStepAnnotatedBody =@@ -358,15 +451,51 @@         Core.fieldName = (Core.Name "applicationFunction"),         Core.fieldTerm = Core.TermUnit}})) --- | DSL injection for the injectionTerm variant of hydra.paths.SubtermStep-subtermStepInjectionTerm :: Typed.TypedTerm Paths.SubtermStep-subtermStepInjectionTerm =+-- | DSL injection for the casesCase variant of hydra.paths.SubtermStep+subtermStepCasesCase :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Paths.SubtermStep+subtermStepCasesCase x =     Typed.TypedTerm (Core.TermInject (Core.Injection {       Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),       Core.injectionField = Core.Field {-        Core.fieldName = (Core.Name "injectionTerm"),+        Core.fieldName = (Core.Name "casesCase"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the casesDefault variant of hydra.paths.SubtermStep+subtermStepCasesDefault :: Typed.TypedTerm Paths.SubtermStep+subtermStepCasesDefault =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "casesDefault"),         Core.fieldTerm = Core.TermUnit}})) +-- | DSL injection for the eitherLeft variant of hydra.paths.SubtermStep+subtermStepEitherLeft :: Typed.TypedTerm Paths.SubtermStep+subtermStepEitherLeft =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "eitherLeft"),+        Core.fieldTerm = Core.TermUnit}}))++-- | DSL injection for the eitherRight variant of hydra.paths.SubtermStep+subtermStepEitherRight :: Typed.TypedTerm Paths.SubtermStep+subtermStepEitherRight =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "eitherRight"),+        Core.fieldTerm = Core.TermUnit}}))++-- | DSL injection for the injectField variant of hydra.paths.SubtermStep+subtermStepInjectField :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Paths.SubtermStep+subtermStepInjectField x =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "injectField"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))+ -- | DSL injection for the lambdaBody variant of hydra.paths.SubtermStep subtermStepLambdaBody :: Typed.TypedTerm Paths.SubtermStep subtermStepLambdaBody =@@ -421,24 +550,33 @@         Core.fieldName = (Core.Name "mapValue"),         Core.fieldTerm = (Typed.unTypedTerm x)}})) --- | DSL injection for the optionalTerm variant of hydra.paths.SubtermStep-subtermStepOptionalTerm :: Typed.TypedTerm Paths.SubtermStep-subtermStepOptionalTerm =+-- | DSL injection for the optionalGiven variant of hydra.paths.SubtermStep+subtermStepOptionalGiven :: Typed.TypedTerm Paths.SubtermStep+subtermStepOptionalGiven =     Typed.TypedTerm (Core.TermInject (Core.Injection {       Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),       Core.injectionField = Core.Field {-        Core.fieldName = (Core.Name "optionalTerm"),+        Core.fieldName = (Core.Name "optionalGiven"),         Core.fieldTerm = Core.TermUnit}})) --- | DSL injection for the productTerm variant of hydra.paths.SubtermStep-subtermStepProductTerm :: Typed.TypedTerm Int -> Typed.TypedTerm Paths.SubtermStep-subtermStepProductTerm x =+-- | DSL injection for the pairFirst variant of hydra.paths.SubtermStep+subtermStepPairFirst :: Typed.TypedTerm Paths.SubtermStep+subtermStepPairFirst =     Typed.TypedTerm (Core.TermInject (Core.Injection {       Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),       Core.injectionField = Core.Field {-        Core.fieldName = (Core.Name "productTerm"),-        Core.fieldTerm = (Typed.unTypedTerm x)}}))+        Core.fieldName = (Core.Name "pairFirst"),+        Core.fieldTerm = Core.TermUnit}})) +-- | DSL injection for the pairSecond variant of hydra.paths.SubtermStep+subtermStepPairSecond :: Typed.TypedTerm Paths.SubtermStep+subtermStepPairSecond =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "pairSecond"),+        Core.fieldTerm = Core.TermUnit}}))+ -- | DSL injection for the recordField variant of hydra.paths.SubtermStep subtermStepRecordField :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Paths.SubtermStep subtermStepRecordField x =@@ -461,22 +599,13 @@ subtermStepSubtermStep :: Typed.TypedName Paths.SubtermStep subtermStepSubtermStep = Typed.TypedName (Core.Name "hydra.paths.SubtermStep") --- | DSL injection for the sumTerm variant of hydra.paths.SubtermStep-subtermStepSumTerm :: Typed.TypedTerm Paths.SubtermStep-subtermStepSumTerm =-    Typed.TypedTerm (Core.TermInject (Core.Injection {-      Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),-      Core.injectionField = Core.Field {-        Core.fieldName = (Core.Name "sumTerm"),-        Core.fieldTerm = Core.TermUnit}}))---- | DSL injection for the typeApplicationTerm variant of hydra.paths.SubtermStep-subtermStepTypeApplicationTerm :: Typed.TypedTerm Paths.SubtermStep-subtermStepTypeApplicationTerm =+-- | DSL injection for the typeApplicationBody variant of hydra.paths.SubtermStep+subtermStepTypeApplicationBody :: Typed.TypedTerm Paths.SubtermStep+subtermStepTypeApplicationBody =     Typed.TypedTerm (Core.TermInject (Core.Injection {       Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),       Core.injectionField = Core.Field {-        Core.fieldName = (Core.Name "typeApplicationTerm"),+        Core.fieldName = (Core.Name "typeApplicationBody"),         Core.fieldTerm = Core.TermUnit}}))  -- | DSL injection for the typeLambdaBody variant of hydra.paths.SubtermStep@@ -488,43 +617,91 @@         Core.fieldName = (Core.Name "typeLambdaBody"),         Core.fieldTerm = Core.TermUnit}})) --- | DSL injection for the unionCasesBranch variant of hydra.paths.SubtermStep-subtermStepUnionCasesBranch :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Paths.SubtermStep-subtermStepUnionCasesBranch x =-    Typed.TypedTerm (Core.TermInject (Core.Injection {-      Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),-      Core.injectionField = Core.Field {-        Core.fieldName = (Core.Name "unionCasesBranch"),-        Core.fieldTerm = (Typed.unTypedTerm x)}}))---- | DSL injection for the unionCasesDefault variant of hydra.paths.SubtermStep-subtermStepUnionCasesDefault :: Typed.TypedTerm Paths.SubtermStep-subtermStepUnionCasesDefault =+-- | DSL injection for the wrapBody variant of hydra.paths.SubtermStep+subtermStepWrapBody :: Typed.TypedTerm Paths.SubtermStep+subtermStepWrapBody =     Typed.TypedTerm (Core.TermInject (Core.Injection {       Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),       Core.injectionField = Core.Field {-        Core.fieldName = (Core.Name "unionCasesDefault"),+        Core.fieldName = (Core.Name "wrapBody"),         Core.fieldTerm = Core.TermUnit}})) --- | DSL injection for the wrappedTerm variant of hydra.paths.SubtermStep-subtermStepWrappedTerm :: Typed.TypedTerm Paths.SubtermStep-subtermStepWrappedTerm =-    Typed.TypedTerm (Core.TermInject (Core.Injection {-      Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),-      Core.injectionField = Core.Field {-        Core.fieldName = (Core.Name "wrappedTerm"),-        Core.fieldTerm = Core.TermUnit}}))+-- | DSL constructor for hydra.paths.SubtypeAttribute+subtypeAttribute :: Typed.TypedTerm Paths.SubtypePath -> Typed.TypedTerm Paths.TypeAttribute -> Typed.TypedTerm Paths.SubtypeAttribute+subtypeAttribute path target =+    Typed.TypedTerm (Core.TermRecord (Core.Record {+      Core.recordTypeName = (Core.Name "hydra.paths.SubtypeAttribute"),+      Core.recordFields = [+        Core.Field {+          Core.fieldName = (Core.Name "path"),+          Core.fieldTerm = (Typed.unTypedTerm path)},+        Core.Field {+          Core.fieldName = (Core.Name "target"),+          Core.fieldTerm = (Typed.unTypedTerm target)}]})) +-- | DSL accessor for the path field of hydra.paths.SubtypeAttribute+subtypeAttributePath :: Typed.TypedTerm Paths.SubtypeAttribute -> Typed.TypedTerm Paths.SubtypePath+subtypeAttributePath x =+    Typed.TypedTerm (Core.TermApplication (Core.Application {+      Core.applicationFunction = (Core.TermProject (Core.Projection {+        Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeAttribute"),+        Core.projectionFieldName = (Core.Name "path")})),+      Core.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.paths.SubtypeAttribute+subtypeAttributeSubtypeAttribute :: Typed.TypedName Paths.SubtypeAttribute+subtypeAttributeSubtypeAttribute = Typed.TypedName (Core.Name "hydra.paths.SubtypeAttribute")++-- | DSL accessor for the target field of hydra.paths.SubtypeAttribute+subtypeAttributeTarget :: Typed.TypedTerm Paths.SubtypeAttribute -> Typed.TypedTerm Paths.TypeAttribute+subtypeAttributeTarget x =+    Typed.TypedTerm (Core.TermApplication (Core.Application {+      Core.applicationFunction = (Core.TermProject (Core.Projection {+        Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeAttribute"),+        Core.projectionFieldName = (Core.Name "target")})),+      Core.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the path field of hydra.paths.SubtypeAttribute+subtypeAttributeWithPath :: Typed.TypedTerm Paths.SubtypeAttribute -> Typed.TypedTerm Paths.SubtypePath -> Typed.TypedTerm Paths.SubtypeAttribute+subtypeAttributeWithPath original newVal =+    Typed.TypedTerm (Core.TermRecord (Core.Record {+      Core.recordTypeName = (Core.Name "hydra.paths.SubtypeAttribute"),+      Core.recordFields = [+        Core.Field {+          Core.fieldName = (Core.Name "path"),+          Core.fieldTerm = (Typed.unTypedTerm newVal)},+        Core.Field {+          Core.fieldName = (Core.Name "target"),+          Core.fieldTerm = (Core.TermApplication (Core.Application {+            Core.applicationFunction = (Core.TermProject (Core.Projection {+              Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeAttribute"),+              Core.projectionFieldName = (Core.Name "target")})),+            Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the target field of hydra.paths.SubtypeAttribute+subtypeAttributeWithTarget :: Typed.TypedTerm Paths.SubtypeAttribute -> Typed.TypedTerm Paths.TypeAttribute -> Typed.TypedTerm Paths.SubtypeAttribute+subtypeAttributeWithTarget original newVal =+    Typed.TypedTerm (Core.TermRecord (Core.Record {+      Core.recordTypeName = (Core.Name "hydra.paths.SubtypeAttribute"),+      Core.recordFields = [+        Core.Field {+          Core.fieldName = (Core.Name "path"),+          Core.fieldTerm = (Core.TermApplication (Core.Application {+            Core.applicationFunction = (Core.TermProject (Core.Projection {+              Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeAttribute"),+              Core.projectionFieldName = (Core.Name "path")})),+            Core.applicationArgument = (Typed.unTypedTerm original)}))},+        Core.Field {+          Core.fieldName = (Core.Name "target"),+          Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))+ -- | DSL constructor for hydra.paths.SubtypeEdge-subtypeEdge :: Typed.TypedTerm Paths.SubtypeNode -> Typed.TypedTerm Paths.SubtypePath -> Typed.TypedTerm Paths.SubtypeNode -> Typed.TypedTerm Paths.SubtypeEdge-subtypeEdge source path target =+subtypeEdge :: Typed.TypedTerm Paths.SubtypePath -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Paths.SubtypeEdge+subtypeEdge path target =     Typed.TypedTerm (Core.TermRecord (Core.Record {       Core.recordTypeName = (Core.Name "hydra.paths.SubtypeEdge"),       Core.recordFields = [         Core.Field {-          Core.fieldName = (Core.Name "source"),-          Core.fieldTerm = (Typed.unTypedTerm source)},-        Core.Field {           Core.fieldName = (Core.Name "path"),           Core.fieldTerm = (Typed.unTypedTerm path)},         Core.Field {@@ -540,21 +717,12 @@         Core.projectionFieldName = (Core.Name "path")})),       Core.applicationArgument = (Typed.unTypedTerm x)})) --- | DSL accessor for the source field of hydra.paths.SubtypeEdge-subtypeEdgeSource :: Typed.TypedTerm Paths.SubtypeEdge -> Typed.TypedTerm Paths.SubtypeNode-subtypeEdgeSource x =-    Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermProject (Core.Projection {-        Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeEdge"),-        Core.projectionFieldName = (Core.Name "source")})),-      Core.applicationArgument = (Typed.unTypedTerm x)}))- -- | DSL name token for hydra.paths.SubtypeEdge subtypeEdgeSubtypeEdge :: Typed.TypedName Paths.SubtypeEdge subtypeEdgeSubtypeEdge = Typed.TypedName (Core.Name "hydra.paths.SubtypeEdge")  -- | DSL accessor for the target field of hydra.paths.SubtypeEdge-subtypeEdgeTarget :: Typed.TypedTerm Paths.SubtypeEdge -> Typed.TypedTerm Paths.SubtypeNode+subtypeEdgeTarget :: Typed.TypedTerm Paths.SubtypeEdge -> Typed.TypedTerm Core.Name subtypeEdgeTarget x =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermProject (Core.Projection {@@ -569,13 +737,6 @@       Core.recordTypeName = (Core.Name "hydra.paths.SubtypeEdge"),       Core.recordFields = [         Core.Field {-          Core.fieldName = (Core.Name "source"),-          Core.fieldTerm = (Core.TermApplication (Core.Application {-            Core.applicationFunction = (Core.TermProject (Core.Projection {-              Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeEdge"),-              Core.projectionFieldName = (Core.Name "source")})),-            Core.applicationArgument = (Typed.unTypedTerm original)}))},-        Core.Field {           Core.fieldName = (Core.Name "path"),           Core.fieldTerm = (Typed.unTypedTerm newVal)},         Core.Field {@@ -586,44 +747,13 @@               Core.projectionFieldName = (Core.Name "target")})),             Core.applicationArgument = (Typed.unTypedTerm original)}))}]})) --- | DSL updater for the source field of hydra.paths.SubtypeEdge-subtypeEdgeWithSource :: Typed.TypedTerm Paths.SubtypeEdge -> Typed.TypedTerm Paths.SubtypeNode -> Typed.TypedTerm Paths.SubtypeEdge-subtypeEdgeWithSource original newVal =-    Typed.TypedTerm (Core.TermRecord (Core.Record {-      Core.recordTypeName = (Core.Name "hydra.paths.SubtypeEdge"),-      Core.recordFields = [-        Core.Field {-          Core.fieldName = (Core.Name "source"),-          Core.fieldTerm = (Typed.unTypedTerm newVal)},-        Core.Field {-          Core.fieldName = (Core.Name "path"),-          Core.fieldTerm = (Core.TermApplication (Core.Application {-            Core.applicationFunction = (Core.TermProject (Core.Projection {-              Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeEdge"),-              Core.projectionFieldName = (Core.Name "path")})),-            Core.applicationArgument = (Typed.unTypedTerm original)}))},-        Core.Field {-          Core.fieldName = (Core.Name "target"),-          Core.fieldTerm = (Core.TermApplication (Core.Application {-            Core.applicationFunction = (Core.TermProject (Core.Projection {-              Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeEdge"),-              Core.projectionFieldName = (Core.Name "target")})),-            Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))- -- | DSL updater for the target field of hydra.paths.SubtypeEdge-subtypeEdgeWithTarget :: Typed.TypedTerm Paths.SubtypeEdge -> Typed.TypedTerm Paths.SubtypeNode -> Typed.TypedTerm Paths.SubtypeEdge+subtypeEdgeWithTarget :: Typed.TypedTerm Paths.SubtypeEdge -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Paths.SubtypeEdge subtypeEdgeWithTarget original newVal =     Typed.TypedTerm (Core.TermRecord (Core.Record {       Core.recordTypeName = (Core.Name "hydra.paths.SubtypeEdge"),       Core.recordFields = [         Core.Field {-          Core.fieldName = (Core.Name "source"),-          Core.fieldTerm = (Core.TermApplication (Core.Application {-            Core.applicationFunction = (Core.TermProject (Core.Projection {-              Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeEdge"),-              Core.projectionFieldName = (Core.Name "source")})),-            Core.applicationArgument = (Typed.unTypedTerm original)}))},-        Core.Field {           Core.fieldName = (Core.Name "path"),           Core.fieldTerm = (Core.TermApplication (Core.Application {             Core.applicationFunction = (Core.TermProject (Core.Projection {@@ -635,26 +765,14 @@           Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))  -- | DSL constructor for hydra.paths.SubtypeGraph-subtypeGraph :: Typed.TypedTerm [Paths.SubtypeNode] -> Typed.TypedTerm [Paths.SubtypeEdge] -> Typed.TypedTerm Paths.SubtypeGraph-subtypeGraph nodes edges =+subtypeGraph :: Typed.TypedTerm [Paths.SubtypeNode] -> Typed.TypedTerm Paths.SubtypeGraph+subtypeGraph nodes =     Typed.TypedTerm (Core.TermRecord (Core.Record {       Core.recordTypeName = (Core.Name "hydra.paths.SubtypeGraph"),       Core.recordFields = [         Core.Field {           Core.fieldName = (Core.Name "nodes"),-          Core.fieldTerm = (Typed.unTypedTerm nodes)},-        Core.Field {-          Core.fieldName = (Core.Name "edges"),-          Core.fieldTerm = (Typed.unTypedTerm edges)}]}))---- | DSL accessor for the edges field of hydra.paths.SubtypeGraph-subtypeGraphEdges :: Typed.TypedTerm Paths.SubtypeGraph -> Typed.TypedTerm [Paths.SubtypeEdge]-subtypeGraphEdges x =-    Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermProject (Core.Projection {-        Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeGraph"),-        Core.projectionFieldName = (Core.Name "edges")})),-      Core.applicationArgument = (Typed.unTypedTerm x)}))+          Core.fieldTerm = (Typed.unTypedTerm nodes)}]}))  -- | DSL accessor for the nodes field of hydra.paths.SubtypeGraph subtypeGraphNodes :: Typed.TypedTerm Paths.SubtypeGraph -> Typed.TypedTerm [Paths.SubtypeNode]@@ -669,23 +787,6 @@ subtypeGraphSubtypeGraph :: Typed.TypedName Paths.SubtypeGraph subtypeGraphSubtypeGraph = Typed.TypedName (Core.Name "hydra.paths.SubtypeGraph") --- | DSL updater for the edges field of hydra.paths.SubtypeGraph-subtypeGraphWithEdges :: Typed.TypedTerm Paths.SubtypeGraph -> Typed.TypedTerm [Paths.SubtypeEdge] -> Typed.TypedTerm Paths.SubtypeGraph-subtypeGraphWithEdges original newVal =-    Typed.TypedTerm (Core.TermRecord (Core.Record {-      Core.recordTypeName = (Core.Name "hydra.paths.SubtypeGraph"),-      Core.recordFields = [-        Core.Field {-          Core.fieldName = (Core.Name "nodes"),-          Core.fieldTerm = (Core.TermApplication (Core.Application {-            Core.applicationFunction = (Core.TermProject (Core.Projection {-              Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeGraph"),-              Core.projectionFieldName = (Core.Name "nodes")})),-            Core.applicationArgument = (Typed.unTypedTerm original)}))},-        Core.Field {-          Core.fieldName = (Core.Name "edges"),-          Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))- -- | DSL updater for the nodes field of hydra.paths.SubtypeGraph subtypeGraphWithNodes :: Typed.TypedTerm Paths.SubtypeGraph -> Typed.TypedTerm [Paths.SubtypeNode] -> Typed.TypedTerm Paths.SubtypeGraph subtypeGraphWithNodes original newVal =@@ -694,18 +795,42 @@       Core.recordFields = [         Core.Field {           Core.fieldName = (Core.Name "nodes"),-          Core.fieldTerm = (Typed.unTypedTerm newVal)},-        Core.Field {-          Core.fieldName = (Core.Name "edges"),-          Core.fieldTerm = (Core.TermApplication (Core.Application {-            Core.applicationFunction = (Core.TermProject (Core.Projection {-              Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeGraph"),-              Core.projectionFieldName = (Core.Name "edges")})),-            Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))+          Core.fieldTerm = (Typed.unTypedTerm newVal)}]})) +-- | DSL injection for the attribute variant of hydra.paths.SubtypeLink+subtypeLinkAttribute :: Typed.TypedTerm Paths.SubtypeAttribute -> Typed.TypedTerm Paths.SubtypeLink+subtypeLinkAttribute x =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.SubtypeLink"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "attribute"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the edge variant of hydra.paths.SubtypeLink+subtypeLinkEdge :: Typed.TypedTerm Paths.SubtypeEdge -> Typed.TypedTerm Paths.SubtypeLink+subtypeLinkEdge x =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.SubtypeLink"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "edge"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the property variant of hydra.paths.SubtypeLink+subtypeLinkProperty :: Typed.TypedTerm Paths.SubtypeProperty -> Typed.TypedTerm Paths.SubtypeLink+subtypeLinkProperty x =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.SubtypeLink"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "property"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.paths.SubtypeLink+subtypeLinkSubtypeLink :: Typed.TypedName Paths.SubtypeLink+subtypeLinkSubtypeLink = Typed.TypedName (Core.Name "hydra.paths.SubtypeLink")+ -- | DSL constructor for hydra.paths.SubtypeNode-subtypeNode :: Typed.TypedTerm Core.Name -> Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm Paths.SubtypeNode-subtypeNode name label id =+subtypeNode :: Typed.TypedTerm Core.Name -> Typed.TypedTerm [Paths.SubtypeLink] -> Typed.TypedTerm Paths.SubtypeNode+subtypeNode name links =     Typed.TypedTerm (Core.TermRecord (Core.Record {       Core.recordTypeName = (Core.Name "hydra.paths.SubtypeNode"),       Core.recordFields = [@@ -713,28 +838,16 @@           Core.fieldName = (Core.Name "name"),           Core.fieldTerm = (Typed.unTypedTerm name)},         Core.Field {-          Core.fieldName = (Core.Name "label"),-          Core.fieldTerm = (Typed.unTypedTerm label)},-        Core.Field {-          Core.fieldName = (Core.Name "id"),-          Core.fieldTerm = (Typed.unTypedTerm id)}]}))---- | DSL accessor for the id field of hydra.paths.SubtypeNode-subtypeNodeId :: Typed.TypedTerm Paths.SubtypeNode -> Typed.TypedTerm String-subtypeNodeId x =-    Typed.TypedTerm (Core.TermApplication (Core.Application {-      Core.applicationFunction = (Core.TermProject (Core.Projection {-        Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeNode"),-        Core.projectionFieldName = (Core.Name "id")})),-      Core.applicationArgument = (Typed.unTypedTerm x)}))+          Core.fieldName = (Core.Name "links"),+          Core.fieldTerm = (Typed.unTypedTerm links)}]})) --- | DSL accessor for the label field of hydra.paths.SubtypeNode-subtypeNodeLabel :: Typed.TypedTerm Paths.SubtypeNode -> Typed.TypedTerm String-subtypeNodeLabel x =+-- | DSL accessor for the links field of hydra.paths.SubtypeNode+subtypeNodeLinks :: Typed.TypedTerm Paths.SubtypeNode -> Typed.TypedTerm [Paths.SubtypeLink]+subtypeNodeLinks x =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermProject (Core.Projection {         Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeNode"),-        Core.projectionFieldName = (Core.Name "label")})),+        Core.projectionFieldName = (Core.Name "links")})),       Core.applicationArgument = (Typed.unTypedTerm x)}))  -- | DSL accessor for the name field of hydra.paths.SubtypeNode@@ -750,9 +863,9 @@ subtypeNodeSubtypeNode :: Typed.TypedName Paths.SubtypeNode subtypeNodeSubtypeNode = Typed.TypedName (Core.Name "hydra.paths.SubtypeNode") --- | DSL updater for the id field of hydra.paths.SubtypeNode-subtypeNodeWithId :: Typed.TypedTerm Paths.SubtypeNode -> Typed.TypedTerm String -> Typed.TypedTerm Paths.SubtypeNode-subtypeNodeWithId original newVal =+-- | DSL updater for the links field of hydra.paths.SubtypeNode+subtypeNodeWithLinks :: Typed.TypedTerm Paths.SubtypeNode -> Typed.TypedTerm [Paths.SubtypeLink] -> Typed.TypedTerm Paths.SubtypeNode+subtypeNodeWithLinks original newVal =     Typed.TypedTerm (Core.TermRecord (Core.Record {       Core.recordTypeName = (Core.Name "hydra.paths.SubtypeNode"),       Core.recordFields = [@@ -764,40 +877,9 @@               Core.projectionFieldName = (Core.Name "name")})),             Core.applicationArgument = (Typed.unTypedTerm original)}))},         Core.Field {-          Core.fieldName = (Core.Name "label"),-          Core.fieldTerm = (Core.TermApplication (Core.Application {-            Core.applicationFunction = (Core.TermProject (Core.Projection {-              Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeNode"),-              Core.projectionFieldName = (Core.Name "label")})),-            Core.applicationArgument = (Typed.unTypedTerm original)}))},-        Core.Field {-          Core.fieldName = (Core.Name "id"),+          Core.fieldName = (Core.Name "links"),           Core.fieldTerm = (Typed.unTypedTerm newVal)}]})) --- | DSL updater for the label field of hydra.paths.SubtypeNode-subtypeNodeWithLabel :: Typed.TypedTerm Paths.SubtypeNode -> Typed.TypedTerm String -> Typed.TypedTerm Paths.SubtypeNode-subtypeNodeWithLabel original newVal =-    Typed.TypedTerm (Core.TermRecord (Core.Record {-      Core.recordTypeName = (Core.Name "hydra.paths.SubtypeNode"),-      Core.recordFields = [-        Core.Field {-          Core.fieldName = (Core.Name "name"),-          Core.fieldTerm = (Core.TermApplication (Core.Application {-            Core.applicationFunction = (Core.TermProject (Core.Projection {-              Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeNode"),-              Core.projectionFieldName = (Core.Name "name")})),-            Core.applicationArgument = (Typed.unTypedTerm original)}))},-        Core.Field {-          Core.fieldName = (Core.Name "label"),-          Core.fieldTerm = (Typed.unTypedTerm newVal)},-        Core.Field {-          Core.fieldName = (Core.Name "id"),-          Core.fieldTerm = (Core.TermApplication (Core.Application {-            Core.applicationFunction = (Core.TermProject (Core.Projection {-              Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeNode"),-              Core.projectionFieldName = (Core.Name "id")})),-            Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))- -- | DSL updater for the name field of hydra.paths.SubtypeNode subtypeNodeWithName :: Typed.TypedTerm Paths.SubtypeNode -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Paths.SubtypeNode subtypeNodeWithName original newVal =@@ -808,18 +890,11 @@           Core.fieldName = (Core.Name "name"),           Core.fieldTerm = (Typed.unTypedTerm newVal)},         Core.Field {-          Core.fieldName = (Core.Name "label"),-          Core.fieldTerm = (Core.TermApplication (Core.Application {-            Core.applicationFunction = (Core.TermProject (Core.Projection {-              Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeNode"),-              Core.projectionFieldName = (Core.Name "label")})),-            Core.applicationArgument = (Typed.unTypedTerm original)}))},-        Core.Field {-          Core.fieldName = (Core.Name "id"),+          Core.fieldName = (Core.Name "links"),           Core.fieldTerm = (Core.TermApplication (Core.Application {             Core.applicationFunction = (Core.TermProject (Core.Projection {               Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeNode"),-              Core.projectionFieldName = (Core.Name "id")})),+              Core.projectionFieldName = (Core.Name "links")})),             Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))  -- | DSL constructor for the hydra.paths.SubtypePath wrapper@@ -833,6 +908,75 @@ subtypePathSubtypePath :: Typed.TypedName Paths.SubtypePath subtypePathSubtypePath = Typed.TypedName (Core.Name "hydra.paths.SubtypePath") +-- | DSL constructor for hydra.paths.SubtypeProperty+subtypeProperty :: Typed.TypedTerm Paths.SubtypePath -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Paths.SubtypeProperty+subtypeProperty path target =+    Typed.TypedTerm (Core.TermRecord (Core.Record {+      Core.recordTypeName = (Core.Name "hydra.paths.SubtypeProperty"),+      Core.recordFields = [+        Core.Field {+          Core.fieldName = (Core.Name "path"),+          Core.fieldTerm = (Typed.unTypedTerm path)},+        Core.Field {+          Core.fieldName = (Core.Name "target"),+          Core.fieldTerm = (Typed.unTypedTerm target)}]}))++-- | DSL accessor for the path field of hydra.paths.SubtypeProperty+subtypePropertyPath :: Typed.TypedTerm Paths.SubtypeProperty -> Typed.TypedTerm Paths.SubtypePath+subtypePropertyPath x =+    Typed.TypedTerm (Core.TermApplication (Core.Application {+      Core.applicationFunction = (Core.TermProject (Core.Projection {+        Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeProperty"),+        Core.projectionFieldName = (Core.Name "path")})),+      Core.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL name token for hydra.paths.SubtypeProperty+subtypePropertySubtypeProperty :: Typed.TypedName Paths.SubtypeProperty+subtypePropertySubtypeProperty = Typed.TypedName (Core.Name "hydra.paths.SubtypeProperty")++-- | DSL accessor for the target field of hydra.paths.SubtypeProperty+subtypePropertyTarget :: Typed.TypedTerm Paths.SubtypeProperty -> Typed.TypedTerm Core.Type+subtypePropertyTarget x =+    Typed.TypedTerm (Core.TermApplication (Core.Application {+      Core.applicationFunction = (Core.TermProject (Core.Projection {+        Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeProperty"),+        Core.projectionFieldName = (Core.Name "target")})),+      Core.applicationArgument = (Typed.unTypedTerm x)}))++-- | DSL updater for the path field of hydra.paths.SubtypeProperty+subtypePropertyWithPath :: Typed.TypedTerm Paths.SubtypeProperty -> Typed.TypedTerm Paths.SubtypePath -> Typed.TypedTerm Paths.SubtypeProperty+subtypePropertyWithPath original newVal =+    Typed.TypedTerm (Core.TermRecord (Core.Record {+      Core.recordTypeName = (Core.Name "hydra.paths.SubtypeProperty"),+      Core.recordFields = [+        Core.Field {+          Core.fieldName = (Core.Name "path"),+          Core.fieldTerm = (Typed.unTypedTerm newVal)},+        Core.Field {+          Core.fieldName = (Core.Name "target"),+          Core.fieldTerm = (Core.TermApplication (Core.Application {+            Core.applicationFunction = (Core.TermProject (Core.Projection {+              Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeProperty"),+              Core.projectionFieldName = (Core.Name "target")})),+            Core.applicationArgument = (Typed.unTypedTerm original)}))}]}))++-- | DSL updater for the target field of hydra.paths.SubtypeProperty+subtypePropertyWithTarget :: Typed.TypedTerm Paths.SubtypeProperty -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Paths.SubtypeProperty+subtypePropertyWithTarget original newVal =+    Typed.TypedTerm (Core.TermRecord (Core.Record {+      Core.recordTypeName = (Core.Name "hydra.paths.SubtypeProperty"),+      Core.recordFields = [+        Core.Field {+          Core.fieldName = (Core.Name "path"),+          Core.fieldTerm = (Core.TermApplication (Core.Application {+            Core.applicationFunction = (Core.TermProject (Core.Projection {+              Core.projectionTypeName = (Core.Name "hydra.paths.SubtypeProperty"),+              Core.projectionFieldName = (Core.Name "path")})),+            Core.applicationArgument = (Typed.unTypedTerm original)}))},+        Core.Field {+          Core.fieldName = (Core.Name "target"),+          Core.fieldTerm = (Typed.unTypedTerm newVal)}]}))+ -- | DSL injection for the annotatedBody variant of hydra.paths.SubtypeStep subtypeStepAnnotatedBody :: Typed.TypedTerm Paths.SubtypeStep subtypeStepAnnotatedBody =@@ -860,6 +1004,15 @@         Core.fieldName = (Core.Name "applicationFunction"),         Core.fieldTerm = Core.TermUnit}})) +-- | DSL injection for the effectValue variant of hydra.paths.SubtypeStep+subtypeStepEffectValue :: Typed.TypedTerm Paths.SubtypeStep+subtypeStepEffectValue =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.SubtypeStep"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "effectValue"),+        Core.fieldTerm = Core.TermUnit}}))+ -- | DSL injection for the eitherLeft variant of hydra.paths.SubtypeStep subtypeStepEitherLeft :: Typed.TypedTerm Paths.SubtypeStep subtypeStepEitherLeft =@@ -990,14 +1143,139 @@         Core.fieldName = (Core.Name "unionField"),         Core.fieldTerm = (Typed.unTypedTerm x)}})) --- | DSL injection for the wrappedType variant of hydra.paths.SubtypeStep-subtypeStepWrappedType :: Typed.TypedTerm Paths.SubtypeStep-subtypeStepWrappedType =+-- | DSL injection for the wrapBody variant of hydra.paths.SubtypeStep+subtypeStepWrapBody :: Typed.TypedTerm Paths.SubtypeStep+subtypeStepWrapBody =     Typed.TypedTerm (Core.TermInject (Core.Injection {       Core.injectionTypeName = (Core.Name "hydra.paths.SubtypeStep"),       Core.injectionField = Core.Field {-        Core.fieldName = (Core.Name "wrappedType"),+        Core.fieldName = (Core.Name "wrapBody"),         Core.fieldTerm = Core.TermUnit}}))++-- | DSL injection for the casesTypeName variant of hydra.paths.TermAttribute+termAttributeCasesTypeName :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Paths.TermAttribute+termAttributeCasesTypeName x =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "casesTypeName"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the injectTypeName variant of hydra.paths.TermAttribute+termAttributeInjectTypeName :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Paths.TermAttribute+termAttributeInjectTypeName x =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "injectTypeName"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the lambdaDomainGiven variant of hydra.paths.TermAttribute+termAttributeLambdaDomainGiven :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Paths.TermAttribute+termAttributeLambdaDomainGiven x =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "lambdaDomainGiven"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the lambdaParameter variant of hydra.paths.TermAttribute+termAttributeLambdaParameter :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Paths.TermAttribute+termAttributeLambdaParameter x =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "lambdaParameter"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the letBindingTypeSchemeGiven variant of hydra.paths.TermAttribute+termAttributeLetBindingTypeSchemeGiven :: Typed.TypedTerm (Core.Name, Core.TypeScheme) -> Typed.TypedTerm Paths.TermAttribute+termAttributeLetBindingTypeSchemeGiven x =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "letBindingTypeSchemeGiven"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the projectFieldName variant of hydra.paths.TermAttribute+termAttributeProjectFieldName :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Paths.TermAttribute+termAttributeProjectFieldName x =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "projectFieldName"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the projectTypeName variant of hydra.paths.TermAttribute+termAttributeProjectTypeName :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Paths.TermAttribute+termAttributeProjectTypeName x =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "projectTypeName"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the recordTypeName variant of hydra.paths.TermAttribute+termAttributeRecordTypeName :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Paths.TermAttribute+termAttributeRecordTypeName x =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "recordTypeName"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.paths.TermAttribute+termAttributeTermAttribute :: Typed.TypedName Paths.TermAttribute+termAttributeTermAttribute = Typed.TypedName (Core.Name "hydra.paths.TermAttribute")++-- | DSL injection for the typeApplicationType variant of hydra.paths.TermAttribute+termAttributeTypeApplicationType :: Typed.TypedTerm Core.Type -> Typed.TypedTerm Paths.TermAttribute+termAttributeTypeApplicationType x =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "typeApplicationType"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the typeLambdaParameter variant of hydra.paths.TermAttribute+termAttributeTypeLambdaParameter :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Paths.TermAttribute+termAttributeTypeLambdaParameter x =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "typeLambdaParameter"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the wrapTypeName variant of hydra.paths.TermAttribute+termAttributeWrapTypeName :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Paths.TermAttribute+termAttributeWrapTypeName x =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "wrapTypeName"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the annotatedAnnotation variant of hydra.paths.TypeAttribute+typeAttributeAnnotatedAnnotation :: Typed.TypedTerm Core.Term -> Typed.TypedTerm Paths.TypeAttribute+typeAttributeAnnotatedAnnotation x =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.TypeAttribute"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "annotatedAnnotation"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL injection for the forallParameter variant of hydra.paths.TypeAttribute+typeAttributeForallParameter :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Paths.TypeAttribute+typeAttributeForallParameter x =+    Typed.TypedTerm (Core.TermInject (Core.Injection {+      Core.injectionTypeName = (Core.Name "hydra.paths.TypeAttribute"),+      Core.injectionField = Core.Field {+        Core.fieldName = (Core.Name "forallParameter"),+        Core.fieldTerm = (Typed.unTypedTerm x)}}))++-- | DSL name token for hydra.paths.TypeAttribute+typeAttributeTypeAttribute :: Typed.TypedName Paths.TypeAttribute+typeAttributeTypeAttribute = Typed.TypedName (Core.Name "hydra.paths.TypeAttribute")  -- | DSL accessor for the body of hydra.paths.SubtermPath unSubtermPath :: Typed.TypedTerm Paths.SubtermPath -> Typed.TypedTerm [Paths.SubtermStep]
src/main/haskell/Hydra/Dsl/Predicates.hs view
@@ -78,6 +78,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | DSL reference to hydra.predicates.isComplexBinding
src/main/haskell/Hydra/Dsl/Print/Docs.hs view
@@ -65,6 +65,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.print.docs.definitionReference definitionReference :: Typed.TypedTerm Packaging.DefinitionReference -> Typed.TypedTerm String
src/main/haskell/Hydra/Dsl/Query.hs view
@@ -12,6 +12,7 @@ import qualified Hydra.Typed as Typed import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL name token for hydra.query.ComparisonConstraint comparisonConstraintComparisonConstraint :: Typed.TypedName Query.ComparisonConstraint
src/main/haskell/Hydra/Dsl/Reduction.hs view
@@ -87,6 +87,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.reduction.alphaConvert alphaConvert :: Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Name -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Term
src/main/haskell/Hydra/Dsl/Refs.hs view
@@ -66,6 +66,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S @@ -86,7 +87,7 @@       Core.applicationArgument = (Typed.unTypedTerm arg1)}))  -- | DSL reference to hydra.refs.encodeMap-encodeMap :: Ord t0 => (Typed.TypedTerm (t0 -> Core.Term) -> Typed.TypedTerm (t1 -> Core.Term) -> Typed.TypedTerm (M.Map t0 t1) -> Typed.TypedTerm Core.Term)+encodeMap :: Typed.TypedTerm (t0 -> Core.Term) -> Typed.TypedTerm (t1 -> Core.Term) -> Typed.TypedTerm (M.Map t0 t1) -> Typed.TypedTerm Core.Term encodeMap arg0 arg1 arg2 =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -124,7 +125,7 @@       Core.applicationArgument = (Typed.unTypedTerm arg0)}))  -- | DSL reference to hydra.refs.encodeSet-encodeSet :: Ord t0 => (Typed.TypedTerm (t0 -> Core.Term) -> Typed.TypedTerm (S.Set t0) -> Typed.TypedTerm Core.Term)+encodeSet :: Typed.TypedTerm (t0 -> Core.Term) -> Typed.TypedTerm (S.Set t0) -> Typed.TypedTerm Core.Term encodeSet arg0 arg1 =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {
src/main/haskell/Hydra/Dsl/Regex.hs view
@@ -12,6 +12,7 @@ import qualified Hydra.Typed as Typed import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL injection for the anchorEnd variant of hydra.regex.Atom atomAnchorEnd :: Typed.TypedTerm Regex.Atom
src/main/haskell/Hydra/Dsl/Relational.hs view
@@ -14,6 +14,7 @@ import qualified Hydra.Typed as Typed import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S 
src/main/haskell/Hydra/Dsl/Resolution.hs view
@@ -76,6 +76,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | DSL reference to hydra.resolution.dereferenceType
src/main/haskell/Hydra/Dsl/Rewriting.hs view
@@ -68,6 +68,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.rewriting.applyInsideTypeLambdasAndAnnotations applyInsideTypeLambdasAndAnnotations :: Typed.TypedTerm (Core.Term -> Core.Term) -> Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Term@@ -262,6 +263,13 @@ subtypes arg0 =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.rewriting.subtypes")),+      Core.applicationArgument = (Typed.unTypedTerm arg0)}))++-- | DSL reference to hydra.rewriting.subtypesWithSteps+subtypesWithSteps :: Typed.TypedTerm Core.Type -> Typed.TypedTerm [(Paths.SubtypeStep, Core.Type)]+subtypesWithSteps arg0 =+    Typed.TypedTerm (Core.TermApplication (Core.Application {+      Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.rewriting.subtypesWithSteps")),       Core.applicationArgument = (Typed.unTypedTerm arg0)}))  -- | DSL reference to hydra.rewriting.wrapTermToRecord
src/main/haskell/Hydra/Dsl/Scoping.hs view
@@ -64,6 +64,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.scoping.extendGraphForLambda extendGraphForLambda :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Lambda -> Typed.TypedTerm Graph.Graph
src/main/haskell/Hydra/Dsl/Serialization.hs view
@@ -66,6 +66,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.serialization.angleBraces angleBraces :: Typed.TypedTerm Ast.Brackets
src/main/haskell/Hydra/Dsl/Sorting.hs view
@@ -66,11 +66,12 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S  -- | DSL reference to hydra.sorting.adjacencyListToMap-adjacencyListToMap :: Ord t0 => (Typed.TypedTerm [(t0, [t1])] -> Typed.TypedTerm (M.Map t0 [t1]))+adjacencyListToMap :: Typed.TypedTerm [(t0, [t1])] -> Typed.TypedTerm (M.Map t0 [t1]) adjacencyListToMap arg0 =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.sorting.adjacencyListToMap")),@@ -93,7 +94,7 @@       Core.applicationArgument = (Typed.unTypedTerm arg1)}))  -- | DSL reference to hydra.sorting.findReachableNodes-findReachableNodes :: Ord t0 => (Typed.TypedTerm (t0 -> S.Set t0) -> Typed.TypedTerm t0 -> Typed.TypedTerm (S.Set t0))+findReachableNodes :: Typed.TypedTerm (t0 -> S.Set t0) -> Typed.TypedTerm t0 -> Typed.TypedTerm (S.Set t0) findReachableNodes arg0 arg1 =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -115,7 +116,7 @@       Core.applicationArgument = (Typed.unTypedTerm arg1)}))  -- | DSL reference to hydra.sorting.propagateTags-propagateTags :: Ord t1 => (Typed.TypedTerm [(t0, [t0])] -> Typed.TypedTerm [(t0, [t1])] -> Typed.TypedTerm [(t0, (S.Set t1))])+propagateTags :: Typed.TypedTerm [(t0, [t0])] -> Typed.TypedTerm [(t0, [t1])] -> Typed.TypedTerm [(t0, (S.Set t1))] propagateTags arg0 arg1 =     Typed.TypedTerm (Core.TermApplication (Core.Application {       Core.applicationFunction = (Core.TermApplication (Core.Application {
src/main/haskell/Hydra/Dsl/Strip.hs view
@@ -66,6 +66,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.strip.deannotateAndDetypeTerm deannotateAndDetypeTerm :: Typed.TypedTerm Core.Term -> Typed.TypedTerm Core.Term
src/main/haskell/Hydra/Dsl/System.hs view
@@ -14,6 +14,7 @@ import qualified Hydra.Typed as Typed import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.ByteString as B import qualified Data.Map as M 
src/main/haskell/Hydra/Dsl/Tabular.hs view
@@ -16,6 +16,7 @@ import qualified Hydra.Typed as Typed import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL constructor for hydra.tabular.ColumnType columnType :: Typed.TypedTerm Relational.ColumnName -> Typed.TypedTerm Core.Type -> Typed.TypedTerm Tabular.ColumnType
src/main/haskell/Hydra/Dsl/Test/Transform.hs view
@@ -68,6 +68,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.test.transform.addGenerationPrefix addGenerationPrefix :: Typed.TypedTerm Packaging.ModuleName -> Typed.TypedTerm Packaging.ModuleName
src/main/haskell/Hydra/Dsl/Test/Utils.hs view
@@ -68,6 +68,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL reference to hydra.test.utils.inferTerm inferTerm :: Typed.TypedTerm Graph.Graph -> Typed.TypedTerm Core.Term -> Typed.TypedTerm (Either String Core.Term)
src/main/haskell/Hydra/Dsl/Testing.hs view
@@ -12,6 +12,7 @@ import qualified Hydra.Typed as Typed import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL constructor for hydra.testing.EffectfulTestCase effectfulTestCase :: Typed.TypedTerm (() -> IO String) -> Typed.TypedTerm (() -> String) -> Typed.TypedTerm Testing.EffectfulTestCase
src/main/haskell/Hydra/Dsl/Time.hs view
@@ -12,6 +12,7 @@ import qualified Hydra.Typed as Typed import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Int as I  -- | DSL constructor for hydra.time.Timespec
src/main/haskell/Hydra/Dsl/Topology.hs view
@@ -14,6 +14,7 @@ import qualified Hydra.Typed as Typed import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S 
src/main/haskell/Hydra/Dsl/Typing.hs view
@@ -16,6 +16,7 @@ import qualified Hydra.Typing as Typing import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | DSL composition builder for the decoder of hydra.typing.FunctionStructure
src/main/haskell/Hydra/Dsl/Util.hs view
@@ -16,6 +16,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | DSL injection for the camel variant of hydra.util.CaseConvention
src/main/haskell/Hydra/Dsl/Validation.hs view
@@ -16,6 +16,7 @@ import qualified Hydra.Validation as Validation import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Set as S  -- | DSL composition builder for the decoder of hydra.validation.ValidationResult
src/main/haskell/Hydra/Dsl/Variables.hs view
@@ -68,6 +68,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S 
src/main/haskell/Hydra/Dsl/Variants.hs view
@@ -12,6 +12,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | DSL injection for the binary variant of hydra.variants.LiteralVariant literalVariantBinary :: Typed.TypedTerm Variants.LiteralVariant
src/main/haskell/Hydra/Dsl/Yaml/Model.hs view
@@ -12,6 +12,7 @@ import qualified Hydra.Yaml.Model as Model import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | DSL injection for the mapping variant of hydra.yaml.model.Node
src/main/haskell/Hydra/Dsls.hs view
@@ -37,8 +37,10 @@ import qualified Hydra.Parsing as Parsing import qualified Hydra.Paths as Paths import qualified Hydra.Query as Query+import qualified Hydra.Reflect as Reflect import qualified Hydra.Regex as Regex import qualified Hydra.Relational as Relational+import qualified Hydra.Rewriting as Rewriting import qualified Hydra.Scoping as Scoping import qualified Hydra.Strip as Strip import qualified Hydra.System as System@@ -53,6 +55,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Collect forall type variable names from a type collectForallVars :: Core.Type -> [Core.Name]@@ -105,10 +108,10 @@           Core.bindingTypeScheme = (Just (Core.TypeScheme {             Core.typeSchemeVariables = [],             Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Type")),-            Core.typeSchemeConstraints = Nothing}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))+            Core.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))       _ -> Nothing) (Packaging.moduleDefinitions mod)))) (\typeBindings -> Eithers.bind (Eithers.mapList (\b -> Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\x -> x) (generateBindingsForType cx graph b)) typeBindings) (\typeDslBindings -> Eithers.bind (Eithers.mapList (\d -> generateRefBindings d) (Packaging.moduleDefinitions mod)) (\refDslBindings ->       let allBindings = deduplicateBindings (Lists.concat2 (Lists.concat typeDslBindings) (Lists.concat refDslBindings))-      in (Logic.ifElse (Lists.null allBindings) (Right Nothing) (Right (Just (Packaging.Module {+      in (Logic.ifElse (Lists.isEmpty allBindings) (Right Nothing) (Right (Just (Packaging.Module {         Packaging.moduleName = (dslModuleName (Packaging.moduleName mod)),         Packaging.moduleMetadata = (Just (Packaging.EntityMetadata {           Packaging.entityMetadataDescription = (Just (Strings.concat [@@ -161,7 +164,7 @@       in Core.TypeScheme {         Core.typeSchemeVariables = typeVars,         Core.typeSchemeBody = funType,-        Core.typeSchemeConstraints = Nothing}+        Core.typeSchemeConstraints = Maps.empty}  -- | Build a TypeScheme with TypedTerm-wrapped parameter and result types dslTypeScheme :: Core.Type -> [Core.Type] -> Core.Type -> Core.TypeScheme@@ -181,7 +184,7 @@       in Core.TypeScheme {         Core.typeSchemeVariables = typeVars,         Core.typeSchemeBody = funType,-        Core.typeSchemeConstraints = Nothing}+        Core.typeSchemeConstraints = Maps.empty}  -- | Filter bindings to only DSL-eligible type definitions filterTypeBindings :: t0 -> t1 -> [Core.Binding] -> Either t2 [Core.Binding]@@ -220,7 +223,7 @@ generateParametricRefBuilders origType typeName =        let vars = collectForallVars origType-      in (Logic.ifElse (Lists.null vars) [] [+      in (Logic.ifElse (Lists.isEmpty vars) [] [            let vars = collectForallVars origType               localName = Names.localNameOf typeName@@ -611,10 +614,10 @@ generateRefBindings d =     case d of       Packaging.DefinitionType _ -> Right []-      Packaging.DefinitionTerm v0 -> Optionals.match (Packaging.termDefinitionSignature v0) (Right []) (\sig -> Right [-        generateSignatureRef (Packaging.termDefinitionName v0) sig])-      Packaging.DefinitionPrimitive v0 -> Right [-        generateSignatureRef (Packaging.primitiveDefinitionName v0) (Packaging.primitiveDefinitionSignature v0)]+      Packaging.DefinitionTerm v0 -> Optionals.match (Packaging.termDefinitionSignature v0) (Right []) (\sig -> Logic.ifElse (signatureIsVoidFree sig) (Right [+        generateSignatureRef (Packaging.termDefinitionName v0) sig]) (Right []))+      Packaging.DefinitionPrimitive v0 -> Logic.ifElse (signatureIsVoidFree (Packaging.primitiveDefinitionSignature v0)) (Right [+        generateSignatureRef (Packaging.primitiveDefinitionName v0) (Packaging.primitiveDefinitionSignature v0)]) (Right [])       _ -> Right []  -- | Generate a typed-reference DSL wrapper from a term/primitive name and signature@@ -696,7 +699,7 @@                     Core.typeSchemeBody = (Core.TypeApplication (Core.ApplicationType {                       Core.applicationTypeFunction = (Core.TypeVariable (Core.Name "hydra.typed.TypedName")),                       Core.applicationTypeArgument = (nominalResultType typeName origType)})),-                    Core.typeSchemeConstraints = Nothing}+                    Core.typeSchemeConstraints = Maps.empty}       in Core.Binding {         Core.bindingName = tokenName,         Core.bindingTerm = body,@@ -887,3 +890,19 @@       in (Lists.foldl (\acc -> \v -> Core.TypeApplication (Core.ApplicationType {         Core.applicationTypeFunction = acc,         Core.applicationTypeArgument = (Core.TypeVariable v)})) (Core.TypeVariable typeName) vars)++-- | Check whether a term signature's parameter and result types are all void-free+signatureIsVoidFree :: Typing.TermSignature -> Bool+signatureIsVoidFree sig =++      let paramTypes = Lists.map (\p -> Typing.parameterType p) (Typing.termSignatureParameters sig)+          resultType = Typing.resultType (Typing.termSignatureResult sig)+      in (Lists.foldl (\acc -> \t -> Logic.and acc (typeIsVoidFree t)) (typeIsVoidFree resultType) paramTypes)++-- | Check whether a type contains no occurrence of the void type at any depth+typeIsVoidFree :: Core.Type -> Bool+typeIsVoidFree typ =++      let allVariants =+              Sets.fromList (Lists.map Reflect.typeVariant (Rewriting.foldOverType Coders.TraversalOrderPre (\m -> \t -> Lists.cons t m) [] typ))+      in (Logic.not (Sets.member Variants.TypeVariantVoid allVariants))
src/main/haskell/Hydra/Encode/Ast.hs view
@@ -11,6 +11,7 @@ import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.ast.Associativity associativity :: Ast.Associativity -> Core.Term
src/main/haskell/Hydra/Encode/Coders.hs view
@@ -13,6 +13,7 @@ import qualified Hydra.Encode.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.coders.CaseConventions caseConventions :: Coders.CaseConventions -> Core.Term
src/main/haskell/Hydra/Encode/Core.hs view
@@ -13,6 +13,7 @@ import qualified Hydra.Overlay.Haskell.Lib.Sets as Sets import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.core.AnnotatedTerm annotatedTerm :: Core.AnnotatedTerm -> Core.Term@@ -732,7 +733,7 @@           Core.fieldTerm = (type_ (Core.typeSchemeBody x))},         Core.Field {           Core.fieldName = (Core.Name "constraints"),-          Core.fieldTerm = ((\opt -> Core.TermOptional (Optionals.map (\m -> Core.TermMap (Maps.bimap name typeVariableConstraints m)) opt)) (Core.typeSchemeConstraints x))}]})+          Core.fieldTerm = ((\m -> Core.TermMap (Maps.bimap name typeVariableConstraints m)) (Core.typeSchemeConstraints x))}]})  -- | Encoder for hydra.core.TypeVariableConstraints typeVariableConstraints :: Core.TypeVariableConstraints -> Core.Term@@ -742,7 +743,7 @@       Core.recordFields = [         Core.Field {           Core.fieldName = (Core.Name "classes"),-          Core.fieldTerm = ((\xs -> Core.TermList (Lists.map typeClassConstraint xs)) (Core.typeVariableConstraintsClasses x))}]})+          Core.fieldTerm = ((\s -> Core.TermSet (Sets.map typeClassConstraint s)) (Core.typeVariableConstraintsClasses x))}]})  -- | Encoder for hydra.core.WrappedTerm wrappedTerm :: Core.WrappedTerm -> Core.Term
src/main/haskell/Hydra/Encode/Docs.hs view
@@ -9,6 +9,7 @@ import qualified Hydra.Encode.Packaging as Packaging import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.docs.DocSegment docSegment :: Docs.DocSegment -> Core.Term
src/main/haskell/Hydra/Encode/Error/Checking.hs view
@@ -14,6 +14,7 @@ import qualified Hydra.Overlay.Haskell.Lib.Sets as Sets import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.error.checking.CheckingError checkingError :: Checking.CheckingError -> Core.Term
src/main/haskell/Hydra/Encode/Error/Core.hs view
@@ -12,6 +12,7 @@ import qualified Hydra.Overlay.Haskell.Lib.Lists as Lists import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.error.core.ConstantConditionError constantConditionError :: ErrorCore.ConstantConditionError -> Core.Term
src/main/haskell/Hydra/Encode/Error/File.hs view
@@ -9,6 +9,7 @@ import qualified Hydra.Error.File as ErrorFile import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.error.file.FileError fileError :: ErrorFile.FileError -> Core.Term
src/main/haskell/Hydra/Encode/Error/Packaging.hs view
@@ -11,6 +11,7 @@ import qualified Hydra.Error.Packaging as ErrorPackaging import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.error.packaging.ConflictingModuleNameError conflictingModuleNameError :: ErrorPackaging.ConflictingModuleNameError -> Core.Term
src/main/haskell/Hydra/Encode/Error/System.hs view
@@ -9,6 +9,7 @@ import qualified Hydra.Error.System as System import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.error.system.SystemError systemError :: System.SystemError -> Core.Term
src/main/haskell/Hydra/Encode/Errors.hs view
@@ -14,6 +14,7 @@ import qualified Hydra.Errors as Errors import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.errors.DecodingError decodingError :: Errors.DecodingError -> Core.Term
src/main/haskell/Hydra/Encode/File.hs view
@@ -11,6 +11,7 @@ import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.file.FileExtension fileExtension :: File.FileExtension -> Core.Term
src/main/haskell/Hydra/Encode/Json/Model.hs view
@@ -11,6 +11,7 @@ import qualified Hydra.Overlay.Haskell.Lib.Pairs as Pairs import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.json.model.Value value :: Model.Value -> Core.Term
src/main/haskell/Hydra/Encode/Packaging.hs view
@@ -12,6 +12,7 @@ import qualified Hydra.Packaging as Packaging import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.packaging.Definition definition :: Packaging.Definition -> Core.Term
src/main/haskell/Hydra/Encode/Parsing.hs view
@@ -10,6 +10,7 @@ import qualified Hydra.Parsing as Parsing import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.parsing.ParseError parseError :: Parsing.ParseError -> Core.Term
src/main/haskell/Hydra/Encode/Paths.hs view
@@ -7,10 +7,25 @@ import qualified Hydra.Core as Core import qualified Hydra.Encode.Core as EncodeCore import qualified Hydra.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Overlay.Haskell.Lib.Pairs as Pairs import qualified Hydra.Paths as Paths import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void +-- | Encoder for hydra.paths.SubtermAttribute+subtermAttribute :: Paths.SubtermAttribute -> Core.Term+subtermAttribute x =+    Core.TermRecord (Core.Record {+      Core.recordTypeName = (Core.Name "hydra.paths.SubtermAttribute"),+      Core.recordFields = [+        Core.Field {+          Core.fieldName = (Core.Name "path"),+          Core.fieldTerm = (subtermPath (Paths.subtermAttributePath x))},+        Core.Field {+          Core.fieldName = (Core.Name "target"),+          Core.fieldTerm = (termAttribute (Paths.subtermAttributeTarget x))}]})+ -- | Encoder for hydra.paths.SubtermEdge subtermEdge :: Paths.SubtermEdge -> Core.Term subtermEdge x =@@ -18,14 +33,11 @@       Core.recordTypeName = (Core.Name "hydra.paths.SubtermEdge"),       Core.recordFields = [         Core.Field {-          Core.fieldName = (Core.Name "source"),-          Core.fieldTerm = (subtermNode (Paths.subtermEdgeSource x))},-        Core.Field {           Core.fieldName = (Core.Name "path"),           Core.fieldTerm = (subtermPath (Paths.subtermEdgePath x))},         Core.Field {           Core.fieldName = (Core.Name "target"),-          Core.fieldTerm = (subtermNode (Paths.subtermEdgeTarget x))}]})+          Core.fieldTerm = (EncodeCore.name (Paths.subtermEdgeTarget x))}]})  -- | Encoder for hydra.paths.SubtermGraph subtermGraph :: Paths.SubtermGraph -> Core.Term@@ -35,11 +47,28 @@       Core.recordFields = [         Core.Field {           Core.fieldName = (Core.Name "nodes"),-          Core.fieldTerm = ((\xs -> Core.TermList (Lists.map subtermNode xs)) (Paths.subtermGraphNodes x))},-        Core.Field {-          Core.fieldName = (Core.Name "edges"),-          Core.fieldTerm = ((\xs -> Core.TermList (Lists.map subtermEdge xs)) (Paths.subtermGraphEdges x))}]})+          Core.fieldTerm = ((\xs -> Core.TermList (Lists.map subtermNode xs)) (Paths.subtermGraphNodes x))}]}) +-- | Encoder for hydra.paths.SubtermLink+subtermLink :: Paths.SubtermLink -> Core.Term+subtermLink x =+    case x of+      Paths.SubtermLinkEdge v0 -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.SubtermLink"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "edge"),+          Core.fieldTerm = (subtermEdge v0)}})+      Paths.SubtermLinkProperty v0 -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.SubtermLink"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "property"),+          Core.fieldTerm = (subtermProperty v0)}})+      Paths.SubtermLinkAttribute v0 -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.SubtermLink"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "attribute"),+          Core.fieldTerm = (subtermAttribute v0)}})+ -- | Encoder for hydra.paths.SubtermNode subtermNode :: Paths.SubtermNode -> Core.Term subtermNode x =@@ -50,11 +79,11 @@           Core.fieldName = (Core.Name "name"),           Core.fieldTerm = (EncodeCore.name (Paths.subtermNodeName x))},         Core.Field {-          Core.fieldName = (Core.Name "label"),-          Core.fieldTerm = ((\x2 -> Core.TermLiteral (Core.LiteralString x2)) (Paths.subtermNodeLabel x))},+          Core.fieldName = (Core.Name "type"),+          Core.fieldTerm = (EncodeCore.typeScheme (Paths.subtermNodeType x))},         Core.Field {-          Core.fieldName = (Core.Name "id"),-          Core.fieldTerm = ((\x2 -> Core.TermLiteral (Core.LiteralString x2)) (Paths.subtermNodeId x))}]})+          Core.fieldName = (Core.Name "links"),+          Core.fieldTerm = ((\xs -> Core.TermList (Lists.map subtermLink xs)) (Paths.subtermNodeLinks x))}]})  -- | Encoder for hydra.paths.SubtermPath subtermPath :: Paths.SubtermPath -> Core.Term@@ -63,50 +92,83 @@       Core.wrappedTermTypeName = (Core.Name "hydra.paths.SubtermPath"),       Core.wrappedTermBody = ((\xs -> Core.TermList (Lists.map subtermStep xs)) (Paths.unSubtermPath x))}) +-- | Encoder for hydra.paths.SubtermProperty+subtermProperty :: Paths.SubtermProperty -> Core.Term+subtermProperty x =+    Core.TermRecord (Core.Record {+      Core.recordTypeName = (Core.Name "hydra.paths.SubtermProperty"),+      Core.recordFields = [+        Core.Field {+          Core.fieldName = (Core.Name "path"),+          Core.fieldTerm = (subtermPath (Paths.subtermPropertyPath x))},+        Core.Field {+          Core.fieldName = (Core.Name "target"),+          Core.fieldTerm = (EncodeCore.term (Paths.subtermPropertyTarget x))}]})+ -- | Encoder for hydra.paths.SubtermStep subtermStep :: Paths.SubtermStep -> Core.Term subtermStep x =     case x of+      Paths.SubtermStepAnnotatedAnnotation -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "annotatedAnnotation"),+          Core.fieldTerm = Core.TermUnit}})       Paths.SubtermStepAnnotatedBody -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),         Core.injectionField = Core.Field {           Core.fieldName = (Core.Name "annotatedBody"),           Core.fieldTerm = Core.TermUnit}})+      Paths.SubtermStepApplicationArgument -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "applicationArgument"),+          Core.fieldTerm = Core.TermUnit}})       Paths.SubtermStepApplicationFunction -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),         Core.injectionField = Core.Field {           Core.fieldName = (Core.Name "applicationFunction"),           Core.fieldTerm = Core.TermUnit}})-      Paths.SubtermStepApplicationArgument -> Core.TermInject (Core.Injection {+      Paths.SubtermStepCasesCase v0 -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),         Core.injectionField = Core.Field {-          Core.fieldName = (Core.Name "applicationArgument"),+          Core.fieldName = (Core.Name "casesCase"),+          Core.fieldTerm = (EncodeCore.name v0)}})+      Paths.SubtermStepCasesDefault -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "casesDefault"),           Core.fieldTerm = Core.TermUnit}})-      Paths.SubtermStepLambdaBody -> Core.TermInject (Core.Injection {+      Paths.SubtermStepEitherLeft -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),         Core.injectionField = Core.Field {-          Core.fieldName = (Core.Name "lambdaBody"),+          Core.fieldName = (Core.Name "eitherLeft"),           Core.fieldTerm = Core.TermUnit}})-      Paths.SubtermStepUnionCasesDefault -> Core.TermInject (Core.Injection {+      Paths.SubtermStepEitherRight -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),         Core.injectionField = Core.Field {-          Core.fieldName = (Core.Name "unionCasesDefault"),+          Core.fieldName = (Core.Name "eitherRight"),           Core.fieldTerm = Core.TermUnit}})-      Paths.SubtermStepUnionCasesBranch v0 -> Core.TermInject (Core.Injection {+      Paths.SubtermStepInjectField v0 -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),         Core.injectionField = Core.Field {-          Core.fieldName = (Core.Name "unionCasesBranch"),+          Core.fieldName = (Core.Name "injectField"),           Core.fieldTerm = (EncodeCore.name v0)}})-      Paths.SubtermStepLetBody -> Core.TermInject (Core.Injection {+      Paths.SubtermStepLambdaBody -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),         Core.injectionField = Core.Field {-          Core.fieldName = (Core.Name "letBody"),+          Core.fieldName = (Core.Name "lambdaBody"),           Core.fieldTerm = Core.TermUnit}})       Paths.SubtermStepLetBinding v0 -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),         Core.injectionField = Core.Field {           Core.fieldName = (Core.Name "letBinding"),           Core.fieldTerm = (EncodeCore.name v0)}})+      Paths.SubtermStepLetBody -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "letBody"),+          Core.fieldTerm = Core.TermUnit}})       Paths.SubtermStepListElement v0 -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),         Core.injectionField = Core.Field {@@ -122,16 +184,21 @@         Core.injectionField = Core.Field {           Core.fieldName = (Core.Name "mapValue"),           Core.fieldTerm = (Core.TermLiteral (Core.LiteralInteger (Core.IntegerValueInt32 v0)))}})-      Paths.SubtermStepOptionalTerm -> Core.TermInject (Core.Injection {+      Paths.SubtermStepOptionalGiven -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),         Core.injectionField = Core.Field {-          Core.fieldName = (Core.Name "optionalTerm"),+          Core.fieldName = (Core.Name "optionalGiven"),           Core.fieldTerm = Core.TermUnit}})-      Paths.SubtermStepProductTerm v0 -> Core.TermInject (Core.Injection {+      Paths.SubtermStepPairFirst -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),         Core.injectionField = Core.Field {-          Core.fieldName = (Core.Name "productTerm"),-          Core.fieldTerm = (Core.TermLiteral (Core.LiteralInteger (Core.IntegerValueInt32 v0)))}})+          Core.fieldName = (Core.Name "pairFirst"),+          Core.fieldTerm = Core.TermUnit}})+      Paths.SubtermStepPairSecond -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "pairSecond"),+          Core.fieldTerm = Core.TermUnit}})       Paths.SubtermStepRecordField v0 -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),         Core.injectionField = Core.Field {@@ -142,32 +209,35 @@         Core.injectionField = Core.Field {           Core.fieldName = (Core.Name "setElement"),           Core.fieldTerm = (Core.TermLiteral (Core.LiteralInteger (Core.IntegerValueInt32 v0)))}})-      Paths.SubtermStepSumTerm -> Core.TermInject (Core.Injection {+      Paths.SubtermStepTypeApplicationBody -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),         Core.injectionField = Core.Field {-          Core.fieldName = (Core.Name "sumTerm"),+          Core.fieldName = (Core.Name "typeApplicationBody"),           Core.fieldTerm = Core.TermUnit}})       Paths.SubtermStepTypeLambdaBody -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),         Core.injectionField = Core.Field {           Core.fieldName = (Core.Name "typeLambdaBody"),           Core.fieldTerm = Core.TermUnit}})-      Paths.SubtermStepTypeApplicationTerm -> Core.TermInject (Core.Injection {-        Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),-        Core.injectionField = Core.Field {-          Core.fieldName = (Core.Name "typeApplicationTerm"),-          Core.fieldTerm = Core.TermUnit}})-      Paths.SubtermStepInjectionTerm -> Core.TermInject (Core.Injection {-        Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),-        Core.injectionField = Core.Field {-          Core.fieldName = (Core.Name "injectionTerm"),-          Core.fieldTerm = Core.TermUnit}})-      Paths.SubtermStepWrappedTerm -> Core.TermInject (Core.Injection {+      Paths.SubtermStepWrapBody -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtermStep"),         Core.injectionField = Core.Field {-          Core.fieldName = (Core.Name "wrappedTerm"),+          Core.fieldName = (Core.Name "wrapBody"),           Core.fieldTerm = Core.TermUnit}}) +-- | Encoder for hydra.paths.SubtypeAttribute+subtypeAttribute :: Paths.SubtypeAttribute -> Core.Term+subtypeAttribute x =+    Core.TermRecord (Core.Record {+      Core.recordTypeName = (Core.Name "hydra.paths.SubtypeAttribute"),+      Core.recordFields = [+        Core.Field {+          Core.fieldName = (Core.Name "path"),+          Core.fieldTerm = (subtypePath (Paths.subtypeAttributePath x))},+        Core.Field {+          Core.fieldName = (Core.Name "target"),+          Core.fieldTerm = (typeAttribute (Paths.subtypeAttributeTarget x))}]})+ -- | Encoder for hydra.paths.SubtypeEdge subtypeEdge :: Paths.SubtypeEdge -> Core.Term subtypeEdge x =@@ -175,14 +245,11 @@       Core.recordTypeName = (Core.Name "hydra.paths.SubtypeEdge"),       Core.recordFields = [         Core.Field {-          Core.fieldName = (Core.Name "source"),-          Core.fieldTerm = (subtypeNode (Paths.subtypeEdgeSource x))},-        Core.Field {           Core.fieldName = (Core.Name "path"),           Core.fieldTerm = (subtypePath (Paths.subtypeEdgePath x))},         Core.Field {           Core.fieldName = (Core.Name "target"),-          Core.fieldTerm = (subtypeNode (Paths.subtypeEdgeTarget x))}]})+          Core.fieldTerm = (EncodeCore.name (Paths.subtypeEdgeTarget x))}]})  -- | Encoder for hydra.paths.SubtypeGraph subtypeGraph :: Paths.SubtypeGraph -> Core.Term@@ -192,11 +259,28 @@       Core.recordFields = [         Core.Field {           Core.fieldName = (Core.Name "nodes"),-          Core.fieldTerm = ((\xs -> Core.TermList (Lists.map subtypeNode xs)) (Paths.subtypeGraphNodes x))},-        Core.Field {-          Core.fieldName = (Core.Name "edges"),-          Core.fieldTerm = ((\xs -> Core.TermList (Lists.map subtypeEdge xs)) (Paths.subtypeGraphEdges x))}]})+          Core.fieldTerm = ((\xs -> Core.TermList (Lists.map subtypeNode xs)) (Paths.subtypeGraphNodes x))}]}) +-- | Encoder for hydra.paths.SubtypeLink+subtypeLink :: Paths.SubtypeLink -> Core.Term+subtypeLink x =+    case x of+      Paths.SubtypeLinkEdge v0 -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.SubtypeLink"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "edge"),+          Core.fieldTerm = (subtypeEdge v0)}})+      Paths.SubtypeLinkProperty v0 -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.SubtypeLink"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "property"),+          Core.fieldTerm = (subtypeProperty v0)}})+      Paths.SubtypeLinkAttribute v0 -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.SubtypeLink"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "attribute"),+          Core.fieldTerm = (subtypeAttribute v0)}})+ -- | Encoder for hydra.paths.SubtypeNode subtypeNode :: Paths.SubtypeNode -> Core.Term subtypeNode x =@@ -207,11 +291,8 @@           Core.fieldName = (Core.Name "name"),           Core.fieldTerm = (EncodeCore.name (Paths.subtypeNodeName x))},         Core.Field {-          Core.fieldName = (Core.Name "label"),-          Core.fieldTerm = ((\x2 -> Core.TermLiteral (Core.LiteralString x2)) (Paths.subtypeNodeLabel x))},-        Core.Field {-          Core.fieldName = (Core.Name "id"),-          Core.fieldTerm = ((\x2 -> Core.TermLiteral (Core.LiteralString x2)) (Paths.subtypeNodeId x))}]})+          Core.fieldName = (Core.Name "links"),+          Core.fieldTerm = ((\xs -> Core.TermList (Lists.map subtypeLink xs)) (Paths.subtypeNodeLinks x))}]})  -- | Encoder for hydra.paths.SubtypePath subtypePath :: Paths.SubtypePath -> Core.Term@@ -220,6 +301,19 @@       Core.wrappedTermTypeName = (Core.Name "hydra.paths.SubtypePath"),       Core.wrappedTermBody = ((\xs -> Core.TermList (Lists.map subtypeStep xs)) (Paths.unSubtypePath x))}) +-- | Encoder for hydra.paths.SubtypeProperty+subtypeProperty :: Paths.SubtypeProperty -> Core.Term+subtypeProperty x =+    Core.TermRecord (Core.Record {+      Core.recordTypeName = (Core.Name "hydra.paths.SubtypeProperty"),+      Core.recordFields = [+        Core.Field {+          Core.fieldName = (Core.Name "path"),+          Core.fieldTerm = (subtypePath (Paths.subtypePropertyPath x))},+        Core.Field {+          Core.fieldName = (Core.Name "target"),+          Core.fieldTerm = (EncodeCore.type_ (Paths.subtypePropertyTarget x))}]})+ -- | Encoder for hydra.paths.SubtypeStep subtypeStep :: Paths.SubtypeStep -> Core.Term subtypeStep x =@@ -229,15 +323,20 @@         Core.injectionField = Core.Field {           Core.fieldName = (Core.Name "annotatedBody"),           Core.fieldTerm = Core.TermUnit}})+      Paths.SubtypeStepApplicationArgument -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.SubtypeStep"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "applicationArgument"),+          Core.fieldTerm = Core.TermUnit}})       Paths.SubtypeStepApplicationFunction -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtypeStep"),         Core.injectionField = Core.Field {           Core.fieldName = (Core.Name "applicationFunction"),           Core.fieldTerm = Core.TermUnit}})-      Paths.SubtypeStepApplicationArgument -> Core.TermInject (Core.Injection {+      Paths.SubtypeStepEffectValue -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtypeStep"),         Core.injectionField = Core.Field {-          Core.fieldName = (Core.Name "applicationArgument"),+          Core.fieldName = (Core.Name "effectValue"),           Core.fieldTerm = Core.TermUnit}})       Paths.SubtypeStepEitherLeft -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtypeStep"),@@ -254,15 +353,15 @@         Core.injectionField = Core.Field {           Core.fieldName = (Core.Name "forallBody"),           Core.fieldTerm = Core.TermUnit}})-      Paths.SubtypeStepFunctionDomain -> Core.TermInject (Core.Injection {+      Paths.SubtypeStepFunctionCodomain -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtypeStep"),         Core.injectionField = Core.Field {-          Core.fieldName = (Core.Name "functionDomain"),+          Core.fieldName = (Core.Name "functionCodomain"),           Core.fieldTerm = Core.TermUnit}})-      Paths.SubtypeStepFunctionCodomain -> Core.TermInject (Core.Injection {+      Paths.SubtypeStepFunctionDomain -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtypeStep"),         Core.injectionField = Core.Field {-          Core.fieldName = (Core.Name "functionCodomain"),+          Core.fieldName = (Core.Name "functionDomain"),           Core.fieldTerm = Core.TermUnit}})       Paths.SubtypeStepListElement -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtypeStep"),@@ -309,8 +408,83 @@         Core.injectionField = Core.Field {           Core.fieldName = (Core.Name "unionField"),           Core.fieldTerm = (EncodeCore.name v0)}})-      Paths.SubtypeStepWrappedType -> Core.TermInject (Core.Injection {+      Paths.SubtypeStepWrapBody -> Core.TermInject (Core.Injection {         Core.injectionTypeName = (Core.Name "hydra.paths.SubtypeStep"),         Core.injectionField = Core.Field {-          Core.fieldName = (Core.Name "wrappedType"),+          Core.fieldName = (Core.Name "wrapBody"),           Core.fieldTerm = Core.TermUnit}})++-- | Encoder for hydra.paths.TermAttribute+termAttribute :: Paths.TermAttribute -> Core.Term+termAttribute x =+    case x of+      Paths.TermAttributeCasesTypeName v0 -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "casesTypeName"),+          Core.fieldTerm = (EncodeCore.name v0)}})+      Paths.TermAttributeInjectTypeName v0 -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "injectTypeName"),+          Core.fieldTerm = (EncodeCore.name v0)}})+      Paths.TermAttributeLambdaDomainGiven v0 -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "lambdaDomainGiven"),+          Core.fieldTerm = (EncodeCore.type_ v0)}})+      Paths.TermAttributeLambdaParameter v0 -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "lambdaParameter"),+          Core.fieldTerm = (EncodeCore.name v0)}})+      Paths.TermAttributeLetBindingTypeSchemeGiven v0 -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "letBindingTypeSchemeGiven"),+          Core.fieldTerm = (Core.TermPair (Pairs.bimap EncodeCore.name EncodeCore.typeScheme v0))}})+      Paths.TermAttributeProjectFieldName v0 -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "projectFieldName"),+          Core.fieldTerm = (EncodeCore.name v0)}})+      Paths.TermAttributeProjectTypeName v0 -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "projectTypeName"),+          Core.fieldTerm = (EncodeCore.name v0)}})+      Paths.TermAttributeRecordTypeName v0 -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "recordTypeName"),+          Core.fieldTerm = (EncodeCore.name v0)}})+      Paths.TermAttributeTypeApplicationType v0 -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "typeApplicationType"),+          Core.fieldTerm = (EncodeCore.type_ v0)}})+      Paths.TermAttributeTypeLambdaParameter v0 -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "typeLambdaParameter"),+          Core.fieldTerm = (EncodeCore.name v0)}})+      Paths.TermAttributeWrapTypeName v0 -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.TermAttribute"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "wrapTypeName"),+          Core.fieldTerm = (EncodeCore.name v0)}})++-- | Encoder for hydra.paths.TypeAttribute+typeAttribute :: Paths.TypeAttribute -> Core.Term+typeAttribute x =+    case x of+      Paths.TypeAttributeAnnotatedAnnotation v0 -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.TypeAttribute"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "annotatedAnnotation"),+          Core.fieldTerm = (EncodeCore.term v0)}})+      Paths.TypeAttributeForallParameter v0 -> Core.TermInject (Core.Injection {+        Core.injectionTypeName = (Core.Name "hydra.paths.TypeAttribute"),+        Core.injectionField = Core.Field {+          Core.fieldName = (Core.Name "forallParameter"),+          Core.fieldTerm = (EncodeCore.name v0)}})
src/main/haskell/Hydra/Encode/Query.hs view
@@ -11,6 +11,7 @@ import qualified Hydra.Query as Query import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.query.ComparisonConstraint comparisonConstraint :: Query.ComparisonConstraint -> Core.Term
src/main/haskell/Hydra/Encode/Regex.hs view
@@ -10,6 +10,7 @@ import qualified Hydra.Regex as Regex import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.regex.Alternation alternation :: [Regex.RegexSequence] -> Core.Term
src/main/haskell/Hydra/Encode/Relational.hs view
@@ -12,6 +12,7 @@ import qualified Hydra.Relational as Relational import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.relational.ColumnName columnName :: Relational.ColumnName -> Core.Term
src/main/haskell/Hydra/Encode/System.hs view
@@ -13,6 +13,7 @@ import qualified Hydra.System as System import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.system.Command command :: System.Command -> Core.Term
src/main/haskell/Hydra/Encode/Tabular.hs view
@@ -12,6 +12,7 @@ import qualified Hydra.Tabular as Tabular import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.tabular.ColumnType columnType :: Tabular.ColumnType -> Core.Term
src/main/haskell/Hydra/Encode/Testing.hs view
@@ -9,6 +9,7 @@ import qualified Hydra.Testing as Testing import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.testing.Tag tag :: Testing.Tag -> Core.Term
src/main/haskell/Hydra/Encode/Time.hs view
@@ -9,6 +9,7 @@ import qualified Hydra.Time as Time import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.time.Timespec timespec :: Time.Timespec -> Core.Term
src/main/haskell/Hydra/Encode/Topology.hs view
@@ -12,6 +12,7 @@ import qualified Hydra.Topology as Topology import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | Encoder for hydra.topology.Graph
src/main/haskell/Hydra/Encode/Typed.hs view
@@ -9,6 +9,7 @@ import qualified Hydra.Typed as Typed import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.typed.TypedBinding typedBinding :: (a -> Core.Term) -> Typed.TypedBinding a -> Core.Term
src/main/haskell/Hydra/Encode/Typing.hs view
@@ -13,6 +13,7 @@ import qualified Hydra.Typing as Typing import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.typing.FunctionStructure functionStructure :: (env -> Core.Term) -> Typing.FunctionStructure env -> Core.Term
src/main/haskell/Hydra/Encode/Util.hs view
@@ -13,6 +13,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.util.CaseConvention caseConvention :: Util.CaseConvention -> Core.Term
src/main/haskell/Hydra/Encode/Validation.hs view
@@ -12,6 +12,7 @@ import qualified Hydra.Validation as Validation import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.validation.ValidationProfile validationProfile :: Validation.ValidationProfile -> Core.Term
src/main/haskell/Hydra/Encode/Variants.hs view
@@ -9,6 +9,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.variants.LiteralVariant literalVariant :: Variants.LiteralVariant -> Core.Term
src/main/haskell/Hydra/Encode/Yaml/Model.hs view
@@ -11,6 +11,7 @@ import qualified Hydra.Yaml.Model as Model import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Encoder for hydra.yaml.model.Node node :: Model.Node -> Core.Term
src/main/haskell/Hydra/Encoding.hs view
@@ -27,6 +27,7 @@ import qualified Hydra.Overlay.Haskell.Lib.Logic as Logic import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Overlay.Haskell.Lib.Sets as Sets import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings import qualified Hydra.Names as Names import qualified Hydra.Packaging as Packaging@@ -50,6 +51,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Transform a type binding into an encoder binding encodeBinding :: t0 -> Graph.Graph -> Core.Binding -> Either Errors.DecodingError Core.Binding@@ -320,8 +322,8 @@           Core.bindingTypeScheme = (Just (Core.TypeScheme {             Core.typeSchemeVariables = [],             Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Type")),-            Core.typeSchemeConstraints = Nothing}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))-      _ -> Nothing) (Packaging.moduleDefinitions mod)))) (\typeBindings -> Logic.ifElse (Lists.null typeBindings) (Right Nothing) (Eithers.bind (Eithers.mapList (\b -> Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\x -> x) (encodeBinding cx graph b)) typeBindings) (\encodedBindings -> Right (Just (Packaging.Module {+            Core.typeSchemeConstraints = Maps.empty}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0)))+      _ -> Nothing) (Packaging.moduleDefinitions mod)))) (\typeBindings -> Logic.ifElse (Lists.isEmpty typeBindings) (Right Nothing) (Eithers.bind (Eithers.mapList (\b -> Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\x -> x) (encodeBinding cx graph b)) typeBindings) (\encodedBindings -> Right (Just (Packaging.Module {       Packaging.moduleName = (encodeModuleName (Packaging.moduleName mod)),       Packaging.moduleMetadata = (Just (Packaging.EntityMetadata {         Packaging.entityMetadataDescription = (Just (Strings.concat [@@ -744,11 +746,10 @@           allOrdVars = encoderCollectOrdVars typ           ordVars = Lists.filter (\v -> Lists.member v typeVars) allOrdVars           constraints =-                  Logic.ifElse (Lists.null ordVars) Nothing (Just (Maps.fromList (Lists.map (\v -> (+                  Maps.fromList (Lists.map (\v -> (                     v,                     Core.TypeVariableConstraints {-                      Core.typeVariableConstraintsClasses = [-                        Core.TypeClassConstraintSimple (Core.Name "ordering")]})) ordVars)))+                      Core.typeVariableConstraintsClasses = (Sets.singleton (Core.TypeClassConstraintSimple (Core.Name "ordering")))})) ordVars)       in Core.TypeScheme {         Core.typeSchemeVariables = typeVars,         Core.typeSchemeBody = encoderFunType,@@ -763,11 +764,10 @@           allOrdVars = encoderCollectOrdVars typ           ordVars = Lists.filter (\v -> Lists.member v typeVars) allOrdVars           constraints =-                  Logic.ifElse (Lists.null ordVars) Nothing (Just (Maps.fromList (Lists.map (\v -> (+                  Maps.fromList (Lists.map (\v -> (                     v,                     Core.TypeVariableConstraints {-                      Core.typeVariableConstraintsClasses = [-                        Core.TypeClassConstraintSimple (Core.Name "ordering")]})) ordVars)))+                      Core.typeVariableConstraintsClasses = (Sets.singleton (Core.TypeClassConstraintSimple (Core.Name "ordering")))})) ordVars)       in Core.TypeScheme {         Core.typeSchemeVariables = typeVars,         Core.typeSchemeBody = encoderFunType,
src/main/haskell/Hydra/Environment.hs view
@@ -50,6 +50,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | Convert a definition to a typed term@@ -129,23 +130,23 @@                 _ -> Core.TypeScheme {                   Core.typeSchemeVariables = (Lists.reverse vars),                   Core.typeSchemeBody = typ,-                  Core.typeSchemeConstraints = Nothing}+                  Core.typeSchemeConstraints = Maps.empty}           decodeType = \term -> Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\_a -> _a) (DecodeCore.type_ g term)           decodeTypeScheme = \term -> Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\_a -> _a) (DecodeCore.typeScheme g term)           toPair =                   \el ->                     let forTerm =                             \term -> case term of-                              Core.TermRecord v0 -> Logic.ifElse (Equality.equal (Core.recordTypeName v0) (Core.Name "hydra.core.TypeScheme")) (Eithers.map Optionals.pure (decodeTypeScheme (Core.bindingTerm el))) (Right Nothing)+                              Core.TermRecord v0 -> Logic.ifElse (Equality.equal (Core.recordTypeName v0) (Core.Name "hydra.core.TypeScheme")) (Eithers.map Optionals.given (decodeTypeScheme (Core.bindingTerm el))) (Right Nothing)                               Core.TermInject v0 -> Logic.ifElse (Equality.equal (Core.injectionTypeName v0) (Core.Name "hydra.core.Type")) (Eithers.map (\decoded -> Just (toTypeScheme [] decoded)) (decodeType (Core.bindingTerm el))) (Right Nothing)                               _ -> Right Nothing                     in (Eithers.bind (Optionals.match (Core.bindingTypeScheme el) (Eithers.map (\typ -> Just (Scoping.fTypeToTypeScheme typ)) (decodeType (Core.bindingTerm el))) (\ts -> Logic.ifElse (Equality.equal ts (Core.TypeScheme {                       Core.typeSchemeVariables = [],                       Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.TypeScheme")),-                      Core.typeSchemeConstraints = Nothing})) (Eithers.map Optionals.pure (decodeTypeScheme (Core.bindingTerm el))) (Logic.ifElse (Equality.equal ts (Core.TypeScheme {+                      Core.typeSchemeConstraints = Maps.empty})) (Eithers.map Optionals.given (decodeTypeScheme (Core.bindingTerm el))) (Logic.ifElse (Equality.equal ts (Core.TypeScheme {                       Core.typeSchemeVariables = [],                       Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Type")),-                      Core.typeSchemeConstraints = Nothing})) (Eithers.map (\decoded -> Just (toTypeScheme [] decoded)) (decodeType (Core.bindingTerm el))) (forTerm (Strip.deannotateTerm (Core.bindingTerm el)))))) (\mts -> Right (Optionals.map (\ts -> (Core.bindingName el, ts)) mts)))+                      Core.typeSchemeConstraints = Maps.empty})) (Eithers.map (\decoded -> Just (toTypeScheme [] decoded)) (decodeType (Core.bindingTerm el))) (forTerm (Strip.deannotateTerm (Core.bindingTerm el)))))) (\mts -> Right (Optionals.map (\ts -> (Core.bindingName el, ts)) mts)))       in (Eithers.map (\mpairs -> Maps.fromList (Optionals.givens mpairs)) (Eithers.mapList toPair (Lexical.graphToBindings g)))  -- | Extract the bindings from a let term, or return an empty list for other terms
src/main/haskell/Hydra/Error/Checking.hs view
@@ -10,6 +10,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Set as S  -- | An error that occurred during type checking
src/main/haskell/Hydra/Error/Core.hs view
@@ -9,6 +9,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | An application of ifElse where the condition is a literal boolean, creating a dead branch (optional) data ConstantConditionError =
src/main/haskell/Hydra/Error/File.hs view
@@ -8,6 +8,7 @@ import qualified Hydra.File as File import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | A recoverable file-system error data FileError =
src/main/haskell/Hydra/Error/Packaging.hs view
@@ -9,6 +9,7 @@ import qualified Hydra.Util as Util import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | A module name which, when mapped to a target language's directory or package structure, conflicts with another module's mapped name. For example, hydra.foo.bar and hydra.fooBar might both map to the same directory in a case-insensitive filesystem. data ConflictingModuleNameError =
src/main/haskell/Hydra/Error/System.hs view
@@ -8,6 +8,7 @@ import qualified Hydra.File as File import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | A recoverable failure to launch a process or to perform a hydra.lib.system system call, named after the POSIX errno values the host reports. A child that launches successfully and then exits non-zero is not a SystemError; it is a ProcessResult with a non-zero exitCode data SystemError =
src/main/haskell/Hydra/Errors.hs view
@@ -12,6 +12,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | An error that occurred during decoding of a term newtype DecodingError =
src/main/haskell/Hydra/Extract/Core.hs view
@@ -49,6 +49,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.ByteString as B import qualified Data.Int as I import qualified Data.Map as M@@ -195,7 +196,7 @@                   Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {                     Errors.unexpectedShapeErrorExpected = (Strings.concat2 "field " (Core.unName fname)),                     Errors.unexpectedShapeErrorActual = "no matching field"})))-      in (Logic.ifElse (Lists.null matchingFields) noMatchErr (Logic.ifElse (Equality.equal (Lists.length matchingFields) 1) (Optionals.match (Lists.head matchingFields) noMatchErr (\mf -> Eithers.bind (Lexical.stripAndDereferenceTerm graph (Core.fieldTerm mf)) (\stripped -> mapping stripped))) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {+      in (Logic.ifElse (Lists.isEmpty matchingFields) noMatchErr (Logic.ifElse (Equality.equal (Lists.length matchingFields) 1) (Optionals.match (Lists.head matchingFields) noMatchErr (\mf -> Eithers.bind (Lexical.stripAndDereferenceTerm graph (Core.fieldTerm mf)) (\stripped -> mapping stripped))) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {         Errors.unexpectedShapeErrorExpected = "single field",         Errors.unexpectedShapeErrorActual = (Strings.concat2 "multiple fields named " (Core.unName fname))})))))) @@ -358,7 +359,7 @@             noBindingErr =                     Left (Errors.ErrorExtraction (Errors.ExtractionErrorNoSuchBinding (Errors.NoSuchBindingError {                       Errors.noSuchBindingErrorName = name})))-        in (Logic.ifElse (Lists.null matchingBindings) noBindingErr (Logic.ifElse (Equality.equal (Lists.length matchingBindings) 1) (Optionals.match (Lists.head matchingBindings) noBindingErr (\b -> Right (Core.bindingTerm b))) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorMultipleBindings (Errors.MultipleBindingsError {+        in (Logic.ifElse (Lists.isEmpty matchingBindings) noBindingErr (Logic.ifElse (Equality.equal (Lists.length matchingBindings) 1) (Optionals.match (Lists.head matchingBindings) noBindingErr (\b -> Right (Core.bindingTerm b))) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorMultipleBindings (Errors.MultipleBindingsError {           Errors.multipleBindingsErrorName = name}))))))))  -- | Extract a list of terms from a term@@ -425,16 +426,16 @@ nArgs name n args =     Logic.ifElse (Equality.equal (Lists.length args) n) (Right ()) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {       Errors.unexpectedShapeErrorExpected = (Strings.concat [-        Literals.showInt32 n,+        Literals.printInt32 n,         " arguments to primitive ",         (Literals.printString (Core.unName name))]),-      Errors.unexpectedShapeErrorActual = (Literals.showInt32 (Lists.length args))}))))+      Errors.unexpectedShapeErrorActual = (Literals.printInt32 (Lists.length args))}))))  -- | Extract an optional value from a term, applying a function to the value if present optionalTerm :: (Core.Term -> Either Errors.Error t0) -> Graph.Graph -> Core.Term -> Either Errors.Error (Maybe t0) optionalTerm f graph term0 =     Eithers.bind (Lexical.stripAndDereferenceTerm graph term0) (\term -> case term of-      Core.TermOptional v0 -> Optionals.match v0 (Right Nothing) (\t -> Eithers.map Optionals.pure (f t))+      Core.TermOptional v0 -> Optionals.match v0 (Right Nothing) (\t -> Eithers.map Optionals.given (f t))       _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {         Errors.unexpectedShapeErrorExpected = "optional value",         Errors.unexpectedShapeErrorActual = (PrintCore.term term)}))))
src/main/haskell/Hydra/Extract/Json.hs view
@@ -40,6 +40,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | Extract an array from a JSON value, failing if the value is not an array
src/main/haskell/Hydra/Extract/Util.hs view
@@ -40,6 +40,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Extract a comparison from a term comparison :: t0 -> Graph.Graph -> Core.Term -> Either Errors.Error Util.Comparison
src/main/haskell/Hydra/File.hs view
@@ -8,6 +8,7 @@ import qualified Hydra.Time as Time import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Int as I  -- | A file extension (without the dot), e.g. "json" or "py"
src/main/haskell/Hydra/Formatting.hs view
@@ -46,6 +46,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Set as S  -- | Capitalize the first letter of a string@@ -119,17 +120,17 @@ -- | Split a string into lines on newline (U+000A); a trailing newline is consumed without producing an empty trailing element, and the empty string yields the empty list. lines :: String -> [String] lines s =-    Logic.ifElse (Strings.null s) [] (+    Logic.ifElse (Strings.isEmpty s) [] (       let parts = Strings.splitOn "\n" s-      in (Optionals.withDefault parts (Optionals.map (\lst -> Logic.ifElse (Strings.null lst) (Optionals.withDefault parts (Lists.init parts)) parts) (Lists.last parts))))+      in (Optionals.withDefault parts (Optionals.map (\lst -> Logic.ifElse (Strings.isEmpty lst) (Optionals.withDefault parts (Lists.init parts)) parts) (Lists.last parts))))  -- | A helper which maps the first letter of a string to another string mapFirstLetter :: (String -> String) -> String -> String mapFirstLetter mapping s =-    Logic.ifElse (Strings.null s) s (+    Logic.ifElse (Strings.isEmpty s) s (       let list = Strings.toList s       in (Optionals.withDefault s (Optionals.map (\uc ->-        let firstLetter = mapping (Strings.fromList (Lists.pure (Pairs.first uc)))+        let firstLetter = mapping (Strings.fromList (Lists.singleton (Pairs.first uc)))         in (Strings.concat2 firstLetter (Strings.fromList (Pairs.second uc)))) (Lists.uncons list))))  -- | Replace sequences of non-alphanumeric characters with single underscores@@ -151,7 +152,7 @@ normalizeComment s =        let stripped = stripLeadingAndTrailingWhitespace s-      in (Logic.ifElse (Strings.null stripped) "" (+      in (Logic.ifElse (Strings.isEmpty stripped) "" (         let lastIdx = Math.sub (Strings.length stripped) 1             appended = Strings.concat2 stripped "."         in (Optionals.match (Strings.charAt lastIdx stripped) appended (\lastChar -> Logic.ifElse (Equality.equal lastChar 46) stripped appended))))@@ -216,7 +217,7 @@                 (124, "verbar"),                 (125, "rcub"),                 (126, "tilde")]-          alias = \c -> Optionals.withDefault (Lists.pure c) (Optionals.map Strings.toList (Maps.lookup c aliases))+          alias = \c -> Optionals.withDefault (Lists.singleton c) (Optionals.map Strings.toList (Maps.lookup c aliases))       in (Strings.fromList (Lists.filter Chars.isAlphaNum (Lists.concat (Lists.map alias (Strings.toList original)))))  -- | A simple soft line wrap which is suitable for code comments@@ -230,6 +231,6 @@                             Lists.span (\c -> Logic.and (Logic.not (Equality.equal c 32)) (Logic.not (Equality.equal c 9))) (Lists.reverse trunc)                     prefix = Lists.reverse (Pairs.second spanResult)                     suffix = Lists.reverse (Pairs.first spanResult)-                in (Logic.ifElse (Ordering.lte (Lists.length rem) maxlen) (Lists.reverse (Lists.cons rem prev)) (Logic.ifElse (Lists.null prefix) (helper (Lists.cons trunc prev) (Lists.drop maxlen rem)) (Optionals.withDefault (helper (Lists.cons trunc prev) (Lists.drop maxlen rem)) (Optionals.map (\pfxInit -> helper (Lists.cons pfxInit prev) (Lists.concat2 suffix (Lists.drop maxlen rem))) (Lists.init prefix)))))+                in (Logic.ifElse (Ordering.lte (Lists.length rem) maxlen) (Lists.reverse (Lists.cons rem prev)) (Logic.ifElse (Lists.isEmpty prefix) (helper (Lists.cons trunc prev) (Lists.drop maxlen rem)) (Optionals.withDefault (helper (Lists.cons trunc prev) (Lists.drop maxlen rem)) (Optionals.map (\pfxInit -> helper (Lists.cons pfxInit prev) (Lists.concat2 suffix (Lists.drop maxlen rem))) (Lists.init prefix)))))       in (Strings.fromList (Lists.join [         10] (helper [] (Strings.toList input))))
src/main/haskell/Hydra/Graph.hs view
@@ -10,6 +10,7 @@ import qualified Hydra.Typing as Typing import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S 
src/main/haskell/Hydra/Hoisting.hs view
@@ -55,6 +55,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Set as S  -- | Augment bindings with new free variables introduced by substitution, wrapping with lambdas after any type lambdas.@@ -76,16 +77,18 @@                     let freeVars = Sets.toList (Sets.intersection boundVars (Variables.freeVariablesInTerm (Core.bindingTerm b)))                         varTypePairs = Lists.map (\v -> (v, (Maps.lookup v types))) freeVars                         varTypes = Optionals.givens (Lists.map Pairs.second varTypePairs)-                    in (Logic.ifElse (Logic.or (Lists.null freeVars) (Logic.not (Equality.equal (Lists.length varTypes) (Lists.length varTypePairs)))) (b, Nothing) (+                        newTypeScheme =+                                Logic.ifElse (Equality.equal (Lists.length varTypes) (Lists.length varTypePairs)) (Optionals.map (\ts -> Core.TypeScheme {+                                  Core.typeSchemeVariables = (Core.typeSchemeVariables ts),+                                  Core.typeSchemeBody = (Lists.foldl (\acc -> \t -> Core.TypeFunction (Core.FunctionType {+                                    Core.functionTypeDomain = t,+                                    Core.functionTypeCodomain = acc})) (Core.typeSchemeBody ts) (Lists.reverse varTypes)),+                                  Core.typeSchemeConstraints = (Core.typeSchemeConstraints ts)}) (Core.bindingTypeScheme b)) (Core.bindingTypeScheme b)+                    in (Logic.ifElse (Lists.isEmpty freeVars) (b, Nothing) (                       Core.Binding {                         Core.bindingName = (Core.bindingName b),                         Core.bindingTerm = (wrapAfterTypeLambdas varTypePairs (Core.bindingTerm b)),-                        Core.bindingTypeScheme = (Optionals.map (\ts -> Core.TypeScheme {-                          Core.typeSchemeVariables = (Core.typeSchemeVariables ts),-                          Core.typeSchemeBody = (Lists.foldl (\acc -> \t -> Core.TypeFunction (Core.FunctionType {-                            Core.functionTypeDomain = t,-                            Core.functionTypeCodomain = acc})) (Core.typeSchemeBody ts) (Lists.reverse varTypes)),-                          Core.typeSchemeConstraints = (Core.typeSchemeConstraints ts)}) (Core.bindingTypeScheme b))},+                        Core.bindingTypeScheme = newTypeScheme},                       (Just (                         Core.bindingName b,                         (Lists.foldl (\t -> \v -> Core.TermApplication (Core.Application {@@ -97,7 +100,7 @@ -- | Check if a binding has a polymorphic type (non-empty list of type scheme variables) bindingIsPolymorphic :: Core.Binding -> Bool bindingIsPolymorphic binding =-    Optionals.match (Core.bindingTypeScheme binding) False (\ts -> Logic.not (Lists.null (Core.typeSchemeVariables ts)))+    Optionals.match (Core.bindingTypeScheme binding) False (\ts -> Logic.not (Lists.isEmpty (Core.typeSchemeVariables ts)))  -- | Check if a binding's type uses any type variables from the given Graph. Returns True if the free type variables in the binding's type intersect with the type variables in scope (graphTypeVariables). bindingUsesContextTypeVars :: Graph.Graph -> Core.Binding -> Bool@@ -105,7 +108,7 @@     Optionals.match (Core.bindingTypeScheme binding) False (\ts ->       let freeInType = Variables.freeVariablesInType (Core.typeSchemeBody ts)           contextTypeVars = Graph.graphTypeVariables cx-      in (Logic.not (Sets.null (Sets.intersection freeInType contextTypeVars))))+      in (Logic.not (Sets.isEmpty (Sets.intersection freeInType contextTypeVars))))  -- | Count the number of occurrences of a variable name in a term. Assumes no variable shadowing. countVarOccurrences :: Core.Name -> Core.Term -> Int@@ -274,7 +277,7 @@                                         Core.bindingTerm = (Pairs.second p),                                         Core.bindingTypeScheme = origType}) multiRefPairs                             bodyWithCache =-                                    Logic.ifElse (Lists.null cacheBindings) bodySubst (Core.TermLet (Core.Let {+                                    Logic.ifElse (Lists.isEmpty cacheBindings) bodySubst (Core.TermLet (Core.Let {                                       Core.letBindings = cacheBindings,                                       Core.letBody = bodySubst}))                             keepUsSubst = Lists.map (Substitution.substituteInBinding fullSubst) keepUs@@ -288,7 +291,7 @@                             bodyFinal = Substitution.substituteInTerm augmentSubst bodyWithCache                             keepUsFinal = Lists.map (Substitution.substituteInBinding augmentSubst) keepUsSubst                             finalTerm =-                                    Logic.ifElse (Lists.null keepUsFinal) bodyFinal (Core.TermLet (Core.Let {+                                    Logic.ifElse (Lists.isEmpty keepUsFinal) bodyFinal (Core.TermLet (Core.Let {                                       Core.letBindings = keepUsFinal,                                       Core.letBody = bodyFinal}))                         in (@@ -361,7 +364,7 @@                                               "_hoist_",                                               namePrefix,                                               "_",-                                              (Literals.showInt32 newCounter)])+                                              (Literals.printInt32 newCounter)])                                         existingNames = Sets.fromList (Lists.map (\b -> Core.bindingName b) newBindings)                                         freeVarsInSubterm = Variables.freeVariablesInTerm subterm                                         allReserved = Sets.union existingNames freeVarsInSubterm@@ -391,7 +394,7 @@                     transformedSubterm = Pairs.second result                     finalCounter = Pairs.first finalAcc                     bindings = Pairs.second finalAcc-                in (Logic.ifElse (Lists.null bindings) (finalCounter, transformedSubterm) (+                in (Logic.ifElse (Lists.isEmpty bindings) (finalCounter, transformedSubterm) (                   let localLet =                           Core.TermLet (Core.Let {                             Core.letBindings = (Lists.reverse bindings),@@ -510,11 +513,11 @@         Paths.SubtermStepAnnotatedBody -> (True, usedApp)         Paths.SubtermStepLetBody -> (True, usedApp)         Paths.SubtermStepLetBinding _ -> (True, usedApp)-        Paths.SubtermStepTypeApplicationTerm -> (True, usedApp)+        Paths.SubtermStepTypeApplicationBody -> (True, usedApp)         Paths.SubtermStepTypeLambdaBody -> (True, usedApp)         Paths.SubtermStepLambdaBody -> Logic.ifElse usedApp (False, True) (True, False)-        Paths.SubtermStepUnionCasesBranch _ -> Logic.ifElse usedApp (False, True) (True, False)-        Paths.SubtermStepUnionCasesDefault -> Logic.ifElse usedApp (False, True) (True, False)+        Paths.SubtermStepCasesCase _ -> Logic.ifElse usedApp (False, True) (True, False)+        Paths.SubtermStepCasesDefault -> Logic.ifElse usedApp (False, True) (True, False)         Paths.SubtermStepApplicationFunction -> Logic.ifElse usedApp (False, True) (True, True)         Paths.SubtermStepApplicationArgument -> (False, usedApp)         _ -> (False, usedApp)))
src/main/haskell/Hydra/Inference.hs view
@@ -64,6 +64,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S @@ -150,7 +151,7 @@                                     (PrintCore.type_ resolvedType),                                     " does not satisfy constraint ",                                     (Core.unName className)])})))))-                      in (Eithers.bind (Eithers.mapList checkClass (Core.typeVariableConstraintsClasses varConstraints)) (\_ -> Right ()))))+                      in (Eithers.bind (Eithers.mapSet checkClass (Core.typeVariableConstraintsClasses varConstraints)) (\_ -> Right ()))))       in (Eithers.bind (Eithers.mapList checkOne (Maps.toList constraints)) (\_ -> Right ()))  -- | Add (term variable, type scheme) pairs to the graph's bound types@@ -205,11 +206,10 @@           allConstraints = Graph.graphClassConstraints cx           relevantConstraints =                   Maps.fromList (Optionals.givens (Lists.map (\v -> Optionals.map (\meta -> (v, meta)) (Maps.lookup v allConstraints)) vars))-          constraintsMaybe = Logic.ifElse (Maps.null relevantConstraints) Nothing (Just relevantConstraints)       in Core.TypeScheme {         Core.typeSchemeVariables = vars,         Core.typeSchemeBody = typ,-        Core.typeSchemeConstraints = constraintsMaybe}+        Core.typeSchemeConstraints = relevantConstraints}  -- | Return the first element of a list, or Left(Other) with the given description if the list is empty headOrFail :: String -> [t0] -> Either Errors.Error t0@@ -313,7 +313,7 @@             Errors.otherInferenceErrorPath = (Paths.SubtermPath (Lists.reverse (Typing.inferenceContextTrace fcx2))),             Errors.otherInferenceErrorMessage = (Strings.concat [               "Expected a single binding with a type scheme, but got: ",-              (Literals.showInt32 (Lists.length bindings)),+              (Literals.printInt32 (Lists.length bindings)),               " bindings"])})))))))))))  -- | Infer the type of an annotated term (Either version). Paper: inference.tex, rule Ann.@@ -400,7 +400,7 @@             svars = Core.typeSchemeVariables schemaType             stype = Core.typeSchemeBody schemaType         in (Eithers.bind (ExtractCore.unionType tname stype) (\sfields ->-          let fcxDflt = Names.pushSubtermStep Paths.SubtermStepUnionCasesDefault fcx2+          let fcxDflt = Names.pushSubtermStep Paths.SubtermStepCasesDefault fcx2           in (Eithers.bind (Eithers.mapOptional (\t -> inferTypeOfTerm fcxDflt cx t (Strings.concat [             "case ",             (Core.unName tname),@@ -462,12 +462,12 @@           var = Pairs.first varResult           fcx2 = Pairs.second varResult           classConstraints =-                  Logic.ifElse (Sets.null classNames) Maps.empty (Maps.singleton var (Core.TypeVariableConstraints {-                    Core.typeVariableConstraintsClasses = (Lists.map (\n -> Core.TypeClassConstraintSimple n) (Sets.toList classNames))}))-      in (Logic.ifElse (Lists.null els) (Right (yieldWithConstraints fcx2 (buildTypeApplicationTerm [+                  Logic.ifElse (Sets.isEmpty classNames) Maps.empty (Maps.singleton var (Core.TypeVariableConstraints {+                    Core.typeVariableConstraintsClasses = (Sets.map (\n -> Core.TypeClassConstraintSimple n) classNames)}))+      in (Logic.ifElse (Lists.isEmpty els) (Right (yieldWithConstraints fcx2 (buildTypeApplicationTerm [         var] (trmCons [])) (typCons (Core.TypeVariable var)) Substitution.idTypeSubst classConstraints)) (Eithers.bind (inferMany fcx2 cx (Lists.zip els (Lists.map (\i -> Strings.concat [         "#",-        (Literals.showInt32 i)]) (Math.range 1 (Math.add (Lists.length els) 1))))) (\resultsRp ->+        (Literals.printInt32 i)]) (Math.range 1 (Math.add (Lists.length els) 1))))) (\resultsRp ->         let results = Pairs.first resultsRp             fcx3 = Pairs.second resultsRp             terms = Pairs.first results@@ -541,7 +541,7 @@           field = Core.injectionField injection           fname = Core.fieldName field           term = Core.fieldTerm field-          fcxInj = Names.pushSubtermStep Paths.SubtermStepSumTerm fcx+          fcxInj = Names.pushSubtermStep (Paths.SubtermStepInjectField fname) fcx       in (Eithers.bind (inferTypeOfTerm fcxInj cx term "injected term") (\result ->         let fcx2 = Names.restoreTrace fcx (Typing.inferenceResultContext result)         in (Eithers.bind (Resolution.requireSchemaType fcx2 (Graph.graphSchemaTypes cx) tname) (\stRp ->@@ -552,11 +552,16 @@               iterm = Typing.inferenceResultTerm result               ityp = Typing.inferenceResultType result               isubst = Typing.inferenceResultSubst result-          in (Eithers.bind (ExtractCore.unionType tname stype) (\sfields -> Eithers.bind (Resolution.findFieldType fcx3 fname sfields) (\ftyp -> Eithers.bind (mapConstraints fcx3 cx (\subst -> yield fcx3 (buildTypeApplicationTerm svars (Core.TermInject (Core.Injection {+              iconstraints = Typing.inferenceResultClassConstraints result+          in (Eithers.bind (ExtractCore.unionType tname stype) (\sfields -> Eithers.bind (Resolution.findFieldType fcx3 fname sfields) (\ftyp -> Eithers.bind (mapConstraints fcx3 cx (\subst -> Logic.ifElse (Maps.isEmpty iconstraints) (yield fcx3 (buildTypeApplicationTerm svars (Core.TermInject (Core.Injection {             Core.injectionTypeName = tname,             Core.injectionField = Core.Field {               Core.fieldName = fname,-              Core.fieldTerm = iterm}}))) (Resolution.nominalApplication tname (Lists.map (\x -> Core.TypeVariable x) svars)) (Substitution.composeTypeSubst isubst subst)) [+              Core.fieldTerm = iterm}}))) (Resolution.nominalApplication tname (Lists.map (\x -> Core.TypeVariable x) svars)) (Substitution.composeTypeSubst isubst subst)) (yieldWithConstraints fcx3 (buildTypeApplicationTerm svars (Core.TermInject (Core.Injection {+            Core.injectionTypeName = tname,+            Core.injectionField = Core.Field {+              Core.fieldName = fname,+              Core.fieldTerm = iterm}}))) (Resolution.nominalApplication tname (Lists.map (\x -> Core.TypeVariable x) svars)) (Substitution.composeTypeSubst isubst subst) (Substitution.substInClassConstraints subst iconstraints))) [             Typing.TypeConstraint {               Typing.typeConstraintLeft = ftyp,               Typing.typeConstraintRight = ityp,@@ -579,7 +584,7 @@                       Core.TypeScheme {                         Core.typeSchemeVariables = [],                         Core.typeSchemeBody = dom,-                        Core.typeSchemeConstraints = Nothing})] cx+                        Core.typeSchemeConstraints = Maps.empty})] cx           fcxBody = Names.pushSubtermStep Paths.SubtermStepLambdaBody fcx2       in (Eithers.bind (inferTypeOfTerm fcxBody cx2 body "lambda body") (\result ->         let fcx3 = Names.restoreTrace fcx2 (Typing.inferenceResultContext result)@@ -687,7 +692,7 @@                   extendContext (Lists.zip bnames (Lists.map (\t -> Core.TypeScheme {                     Core.typeSchemeVariables = [],                     Core.typeSchemeBody = t,-                    Core.typeSchemeConstraints = Nothing}) tbins0)) cx0+                    Core.typeSchemeConstraints = Maps.empty}) tbins0)) cx0       in (Eithers.bind (inferTypesOfTemporaryBindings fcx2 cx1 bins0) (\irRp ->         let inferredResult = Pairs.first irRp             fcx3 = Pairs.second irRp@@ -703,7 +708,7 @@               constraintsWithS2 = Substitution.substInClassConstraints s2 inferredConstraints               composedSubst = Substitution.composeTypeSubst s1 s2               originalBindingConstraints =-                      Lists.foldl (\acc -> \b -> Optionals.match (Core.bindingTypeScheme b) acc (\ts -> Optionals.match (Core.typeSchemeConstraints ts) acc (\c -> mergeClassConstraints acc c))) Maps.empty bins0+                      Lists.foldl (\acc -> \b -> Optionals.match (Core.bindingTypeScheme b) acc (\ts -> mergeClassConstraints acc (Core.typeSchemeConstraints ts))) Maps.empty bins0               originalConstraintsSubst = Substitution.substInClassConstraints composedSubst originalBindingConstraints               allInferredConstraints = mergeClassConstraints constraintsWithS2 originalConstraintsSubst               mergedConstraints = mergeClassConstraints (Graph.graphClassConstraints g2base) allInferredConstraints@@ -788,9 +793,8 @@           fcx3 = Pairs.second vvarResult           keyConstraints =                   Maps.singleton kvar (Core.TypeVariableConstraints {-                    Core.typeVariableConstraintsClasses = [-                      Core.TypeClassConstraintSimple (Core.Name "ordering")]})-      in (Logic.ifElse (Maps.null m) (Right (yieldWithConstraints fcx3 (buildTypeApplicationTerm [+                    Core.typeVariableConstraintsClasses = (Sets.singleton (Core.TypeClassConstraintSimple (Core.Name "ordering")))})+      in (Logic.ifElse (Maps.isEmpty m) (Right (yieldWithConstraints fcx3 (buildTypeApplicationTerm [         kvar,         vvar] (Core.TermMap Maps.empty)) (Core.TypeMap (Core.MapType {         Core.mapTypeKeys = (Core.TypeVariable kvar),@@ -946,7 +950,7 @@ inferTypeOfTypeApplication :: Typing.InferenceContext -> Graph.Graph -> Core.TypeApplicationTerm -> Either Errors.Error Typing.InferenceResult inferTypeOfTypeApplication fcx cx tt = -      let fcxBody = Names.pushSubtermStep Paths.SubtermStepTypeApplicationTerm fcx+      let fcxBody = Names.pushSubtermStep Paths.SubtermStepTypeApplicationBody fcx       in (Eithers.bind (inferTypeOfTerm fcxBody cx (Core.typeApplicationTermBody tt) "type application term") (\result ->         let fcx2 = Names.restoreTrace fcx (Typing.inferenceResultContext result)         in (Right (Typing.InferenceResult {@@ -1000,12 +1004,12 @@       let tsResult = Resolution.instantiateTypeScheme fcx scheme           ts = Pairs.first tsResult           fcx2 = Pairs.second tsResult-          constraints = Optionals.withDefault Maps.empty (Core.typeSchemeConstraints ts)+          constraints = Core.typeSchemeConstraints ts       in (Right (yieldCheckedWithConstraints fcx2 (buildTypeApplicationTerm (Core.typeSchemeVariables ts) (Core.TermVariable name)) (Core.typeSchemeBody ts) Substitution.idTypeSubst constraints)))) (\scheme ->       let tsResult = Resolution.instantiateTypeScheme fcx scheme           ts = Pairs.first tsResult           fcx2 = Pairs.second tsResult-          constraints = Optionals.withDefault Maps.empty (Core.typeSchemeConstraints ts)+          constraints = Core.typeSchemeConstraints ts       in (Right (Typing.InferenceResult {         Typing.inferenceResultTerm = (buildTypeApplicationTerm (Core.typeSchemeVariables ts) (Core.TermVariable name)),         Typing.inferenceResultType = (Core.typeSchemeBody ts),@@ -1022,7 +1026,7 @@       in (Eithers.bind (Resolution.requireSchemaType fcx (Graph.graphSchemaTypes cx) tname) (\stRp ->         let schemaType = Pairs.first stRp             fcx2 = Pairs.second stRp-            fcxBody = Names.pushSubtermStep Paths.SubtermStepWrappedTerm fcx2+            fcxBody = Names.pushSubtermStep Paths.SubtermStepWrapBody fcx2         in (Eithers.bind (inferTypeOfTerm fcxBody cx term "wrapped term") (\result ->           let fcx3 = Names.restoreTrace fcx2 (Typing.inferenceResultContext result)               svars = Core.typeSchemeVariables schemaType@@ -1064,7 +1068,7 @@           in (Eithers.bind (Optionals.match (Core.bindingTypeScheme binding) (Right Maps.empty) (\ts ->             let tsResult = Resolution.instantiateTypeScheme fcx2 ts                 instantiatedTs = Pairs.first tsResult-                freshConstraints = Optionals.withDefault Maps.empty (Core.typeSchemeConstraints instantiatedTs)+                freshConstraints = Core.typeSchemeConstraints instantiatedTs             in (Eithers.bind (Eithers.bimap (\_e -> Errors.ErrorInference (Errors.InferenceErrorUnification (Errors.UnificationInferenceError {               Errors.unificationInferenceErrorPath = (Paths.SubtermPath (Lists.reverse (Typing.inferenceContextTrace fcx2))),               Errors.unificationInferenceErrorCause = _e}))) (\_a -> _a) (Unification.unifyTypes fcx2 (Graph.graphSchemaTypes cx) (Core.typeSchemeBody instantiatedTs) u_prime "original binding type")) (\unifySubst -> Right (Substitution.substInClassConstraints unifySubst freshConstraints))))) (\originalBindingConstraints ->@@ -1106,7 +1110,7 @@       in (Optionals.match (Maps.lookup k acc) (Maps.insert k v acc) (\existing ->         let merged =                 Core.TypeVariableConstraints {-                  Core.typeVariableConstraintsClasses = (Lists.distinct (Lists.concat2 (Core.typeVariableConstraintsClasses existing) (Core.typeVariableConstraintsClasses v)))}+                  Core.typeVariableConstraintsClasses = (Sets.union (Core.typeVariableConstraintsClasses existing) (Core.typeVariableConstraintsClasses v))}         in (Maps.insert k merged acc)))) m1 (Maps.toList m2)  -- | Show an inference result for debugging
src/main/haskell/Hydra/Json/Bootstrap.hs view
@@ -17,6 +17,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | A bootstrap typing environment for decoding modules from JSON. Maps each kernel type name to its encoded type, used to seed JSON decoding before the full kernel graph is available.@@ -1540,13 +1541,13 @@             Core.FieldType {               Core.fieldTypeName = (Core.Name "constraints"),               Core.fieldTypeType = (Core.TypeAnnotated (Core.AnnotatedType {-                Core.annotatedTypeBody = (Core.TypeOptional (Core.TypeMap (Core.MapType {+                Core.annotatedTypeBody = (Core.TypeMap (Core.MapType {                   Core.mapTypeKeys = (Core.TypeVariable (Core.Name "hydra.core.Name")),-                  Core.mapTypeValues = (Core.TypeVariable (Core.Name "hydra.core.TypeVariableConstraints"))}))),+                  Core.mapTypeValues = (Core.TypeVariable (Core.Name "hydra.core.TypeVariableConstraints"))})),                 Core.annotatedTypeAnnotation = (Core.TermMap (M.fromList [                   (                     Core.TermVariable (Core.Name "description"),-                    (Core.TermLiteral (Core.LiteralString "Optional constraints on type variables, including typeclass constraints. The map keys are type variable names.")))]))}))}]),+                    (Core.TermLiteral (Core.LiteralString "Constraints on type variables, including typeclass constraints. The map keys are type variable names; an empty map means no constraints.")))]))}))}]),           Core.annotatedTypeAnnotation = (Core.TermMap (M.fromList [             (               Core.TermVariable (Core.Name "description"),@@ -1558,7 +1559,7 @@             Core.FieldType {               Core.fieldTypeName = (Core.Name "classes"),               Core.fieldTypeType = (Core.TypeAnnotated (Core.AnnotatedType {-                Core.annotatedTypeBody = (Core.TypeList (Core.TypeVariable (Core.Name "hydra.core.TypeClassConstraint"))),+                Core.annotatedTypeBody = (Core.TypeSet (Core.TypeVariable (Core.Name "hydra.core.TypeClassConstraint"))),                 Core.annotatedTypeAnnotation = (Core.TermMap (M.fromList [                   (                     Core.TermVariable (Core.Name "description"),
src/main/haskell/Hydra/Json/Decode.hs view
@@ -51,6 +51,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | Decode a JSON value to a float term. Finite values arrive as JSON numbers; NaN/Inf/-0.0 arrive as JSON string sentinels. Float32 and Float64 are symmetric.@@ -77,21 +78,21 @@       Core.IntegerTypeBigint ->         let strResult = expectString value         in (Eithers.either (\err -> Left err) (\s ->-          let parsed = LibLiterals.readBigint s+          let parsed = LibLiterals.parseBigint s           in (Optionals.match parsed (Left (Strings.concat [             "invalid bigint: ",             s])) (\v -> Right (Core.TermLiteral (Core.LiteralInteger (Core.IntegerValueBigint v)))))) strResult)       Core.IntegerTypeInt64 ->         let strResult = expectString value         in (Eithers.either (\err -> Left err) (\s ->-          let parsed = LibLiterals.readInt64 s+          let parsed = LibLiterals.parseInt64 s           in (Optionals.match parsed (Left (Strings.concat [             "invalid int64: ",             s])) (\v -> Right (Core.TermLiteral (Core.LiteralInteger (Core.IntegerValueInt64 v)))))) strResult)       Core.IntegerTypeUint64 ->         let strResult = expectString value         in (Eithers.either (\err -> Left err) (\s ->-          let parsed = LibLiterals.readUint64 s+          let parsed = LibLiterals.parseUint64 s           in (Optionals.match parsed (Left (Strings.concat [             "invalid uint64: ",             s])) (\v -> Right (Core.TermLiteral (Core.LiteralInteger (Core.IntegerValueUint64 v)))))) strResult)@@ -113,7 +114,7 @@       Core.IntegerTypeUint32 -> case value of         Model.ValueNumber v1 -> Right (Core.TermLiteral (Core.LiteralInteger (Core.IntegerValueUint32 (LibLiterals.bigintToUint32 (LibLiterals.decimalToBigint v1)))))         Model.ValueString v1 ->-          let parsed = LibLiterals.readUint32 v1+          let parsed = LibLiterals.parseUint32 v1           in (Optionals.match parsed (Left (Strings.concat [             "invalid uint32: ",             v1])) (\v -> Right (Core.TermLiteral (Core.LiteralInteger (Core.IntegerValueUint32 v)))))@@ -321,6 +322,7 @@                               entries = Eithers.mapList decodeCompactEntry obj                           in (Eithers.map (\es -> Core.TermMap (Maps.fromList es)) entries)) (Left "duplicate key in compact map object"))           in case value of+            Model.ValueNull -> Right (Core.TermMap Maps.empty)             Model.ValueArray v1 -> decodeArrayForm v1             Model.ValueObject v1 -> Logic.ifElse compact (decodeCompactForm v1) (Left "expected array for map with non-string-resolving key type")             _ -> Left "expected object or array for map"@@ -359,9 +361,9 @@ -- | Parse an IEEE sentinel string (NaN, Infinity, -Infinity, -0.0) to a float64. Returns Nothing for unrecognized strings. parseSpecialFloat :: String -> Maybe Double parseSpecialFloat s =-    Logic.ifElse (Logic.or (Equality.equal s "NaN") (Logic.or (Equality.equal s "Infinity") (Logic.or (Equality.equal s "-Infinity") (Equality.equal s "-0.0")))) (LibLiterals.readFloat64 s) Nothing+    Logic.ifElse (Logic.or (Equality.equal s "NaN") (Logic.or (Equality.equal s "Infinity") (Logic.or (Equality.equal s "-Infinity") (Equality.equal s "-0.0")))) (LibLiterals.parseFloat64 s) Nothing  -- | Parse an IEEE sentinel string (NaN, Infinity, -Infinity, -0.0) to a float32. Returns Nothing for unrecognized strings. parseSpecialFloat32 :: String -> Maybe Float parseSpecialFloat32 s =-    Logic.ifElse (Logic.or (Equality.equal s "NaN") (Logic.or (Equality.equal s "Infinity") (Logic.or (Equality.equal s "-Infinity") (Equality.equal s "-0.0")))) (LibLiterals.readFloat32 s) Nothing+    Logic.ifElse (Logic.or (Equality.equal s "NaN") (Logic.or (Equality.equal s "Infinity") (Logic.or (Equality.equal s "-Infinity") (Equality.equal s "-0.0")))) (LibLiterals.parseFloat32 s) Nothing
src/main/haskell/Hydra/Json/Decoding.hs view
@@ -39,6 +39,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | Decode a JSON array using a decoder for elements
src/main/haskell/Hydra/Json/Encode.hs view
@@ -51,6 +51,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | Encode a float value to JSON. Finite values become JSON numbers (shortest round-trip); IEEE specials (NaN/Inf/-0.0) become JSON strings. Float32 and Float64 are symmetric; the schema disambiguates precision on decode.@@ -58,19 +59,19 @@ encodeFloat fv =     case fv of       Core.FloatValueFloat32 v0 ->-        let s = LibLiterals.showFloat32 v0+        let s = LibLiterals.printFloat32 v0         in (Logic.ifElse (requiresJsonStringSentinel s) (Right (Model.ValueString s)) (Right (Model.ValueNumber (LibLiterals.float32ToDecimal v0))))       Core.FloatValueFloat64 v0 ->-        let s = LibLiterals.showFloat64 v0+        let s = LibLiterals.printFloat64 v0         in (Logic.ifElse (requiresJsonStringSentinel s) (Right (Model.ValueString s)) (Right (Model.ValueNumber (LibLiterals.float64ToDecimal v0))))  -- | Encode an integer value to JSON. Small ints use native numbers; large ints use strings. encodeInteger :: Core.IntegerValue -> Either t0 Model.Value encodeInteger iv =     case iv of-      Core.IntegerValueBigint v0 -> Right (Model.ValueString (LibLiterals.showBigint v0))-      Core.IntegerValueInt64 v0 -> Right (Model.ValueString (LibLiterals.showInt64 v0))-      Core.IntegerValueUint64 v0 -> Right (Model.ValueString (LibLiterals.showUint64 v0))+      Core.IntegerValueBigint v0 -> Right (Model.ValueString (LibLiterals.printBigint v0))+      Core.IntegerValueInt64 v0 -> Right (Model.ValueString (LibLiterals.printInt64 v0))+      Core.IntegerValueUint64 v0 -> Right (Model.ValueString (LibLiterals.printUint64 v0))       Core.IntegerValueInt8 v0 -> Right (Model.ValueNumber (LibLiterals.bigintToDecimal (LibLiterals.int8ToBigint v0)))       Core.IntegerValueInt16 v0 -> Right (Model.ValueNumber (LibLiterals.bigintToDecimal (LibLiterals.int16ToBigint v0)))       Core.IntegerValueInt32 v0 -> Right (Model.ValueNumber (LibLiterals.bigintToDecimal (LibLiterals.int32ToBigint v0)))
src/main/haskell/Hydra/Json/Model.hs view
@@ -7,6 +7,7 @@ import qualified Hydra.Core as Core import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | A JSON value data Value =
src/main/haskell/Hydra/Json/Parser.hs view
@@ -44,6 +44,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Hydra.Overlay.Haskell.Lib.Literals as Literals  -- | Parse a single digit (0-9)@@ -80,7 +81,7 @@ -- | Parse the optional exponent part of a JSON number jsonExponentPart :: Parsing.Parser (Maybe String) jsonExponentPart =-    Parsers.optional (Parsers.bind (Parsers.satisfy (\c -> Logic.or (Equality.equal c 101) (Equality.equal c 69))) (\_ -> Parsers.bind (Parsers.optional (Parsers.satisfy (\c -> Logic.or (Equality.equal c 43) (Equality.equal c 45)))) (\sign -> Parsers.map (\digits -> Strings.concat2 (Strings.concat2 "e" (Optionals.match sign "" (\arg_ -> Strings.fromList (Lists.pure arg_)))) digits) digits)))+    Parsers.optional (Parsers.bind (Parsers.satisfy (\c -> Logic.or (Equality.equal c 101) (Equality.equal c 69))) (\_ -> Parsers.bind (Parsers.optional (Parsers.satisfy (\c -> Logic.or (Equality.equal c 43) (Equality.equal c 45)))) (\sign -> Parsers.map (\digits -> Strings.concat2 (Strings.concat2 "e" (Optionals.match sign "" (\arg_ -> Strings.fromList (Lists.singleton arg_)))) digits) digits)))  -- | Parse the optional fractional part of a JSON number jsonFractionPart :: Parsing.Parser (Maybe String)@@ -106,7 +107,7 @@     token (Parsers.bind jsonIntegerPart (\intPart -> Parsers.bind jsonFractionPart (\fracPart -> Parsers.bind jsonExponentPart (\expPart ->       let numStr =               Strings.concat2 (Strings.concat2 intPart (Optionals.match fracPart "" Functions.identity)) (Optionals.match expPart "" Functions.identity)-      in (Parsers.pure (Model.ValueNumber (Optionals.match (Literals.readDecimal numStr) (Literals.stringToDecimal "0.0") Functions.identity)))))))+      in (Parsers.pure (Model.ValueNumber (Optionals.match (Literals.parseDecimal numStr) (Literals.stringToDecimal "0.0") Functions.identity)))))))  -- | Parse a JSON object jsonObject :: Parsing.Parser Model.Value
src/main/haskell/Hydra/Json/Writer.hs view
@@ -45,6 +45,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | The colon operator used to separate keys and values in JSON objects colonOp :: Ast.Op@@ -62,7 +63,7 @@ hexByte c =        let nibble =-              \i -> Optionals.withDefault "?" (Optionals.map (\ch -> Strings.fromList (Lists.pure ch)) (Strings.charAt i "0123456789abcdef"))+              \i -> Optionals.withDefault "?" (Optionals.map (\ch -> Strings.fromList (Lists.singleton ch)) (Strings.charAt i "0123456789abcdef"))           hi = nibble (Optionals.withDefault 0 (Math.div c 16))           lo = nibble (Optionals.withDefault 0 (Math.mod c 16))       in (Strings.concat2 hi lo)@@ -73,7 +74,7 @@        let hexEscape = \c -> Strings.concat2 "\\u00" (hexByte c)           escape =-                  \c -> Logic.ifElse (Equality.equal c 34) "\\\"" (Logic.ifElse (Equality.equal c 92) "\\\\" (Logic.ifElse (Equality.equal c 8) "\\b" (Logic.ifElse (Equality.equal c 12) "\\f" (Logic.ifElse (Equality.equal c 10) "\\n" (Logic.ifElse (Equality.equal c 13) "\\r" (Logic.ifElse (Equality.equal c 9) "\\t" (Logic.ifElse (Ordering.lt c 32) (hexEscape c) (Strings.fromList (Lists.pure c)))))))))+                  \c -> Logic.ifElse (Equality.equal c 34) "\\\"" (Logic.ifElse (Equality.equal c 92) "\\\\" (Logic.ifElse (Equality.equal c 8) "\\b" (Logic.ifElse (Equality.equal c 12) "\\f" (Logic.ifElse (Equality.equal c 10) "\\n" (Logic.ifElse (Equality.equal c 13) "\\r" (Logic.ifElse (Equality.equal c 9) "\\t" (Logic.ifElse (Ordering.lt c 32) (hexEscape c) (Strings.fromList (Lists.singleton c)))))))))           escaped = Strings.concat (Lists.map escape (Strings.toList s))       in (Strings.concat2 (Strings.concat2 "\"" escaped) "\"") @@ -98,9 +99,9 @@       Model.ValueNull -> Serialization.cst "null"       Model.ValueNumber v0 ->         let rounded = Literals.decimalToBigint v0-            shown = Literals.showDecimal v0+            shown = Literals.printDecimal v0             isWhole = Equality.equal v0 (Literals.bigintToDecimal rounded)-            plain = Literals.showBigint rounded+            plain = Literals.printBigint rounded         in (Serialization.cst (Logic.ifElse (Logic.and isWhole (Ordering.lte (Strings.length plain) (Strings.length shown))) plain shown))       Model.ValueObject v0 -> Serialization.bracesListAdaptive (Lists.map keyValueToExpr v0)       Model.ValueString v0 -> Serialization.cst (jsonString v0)
src/main/haskell/Hydra/Json/Yaml/Decode.hs view
@@ -41,6 +41,7 @@ import qualified Hydra.Yaml.Model as YamlModel import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | Decode a YAML node to a Hydra term via JSON decoding.
src/main/haskell/Hydra/Json/Yaml/Encode.hs view
@@ -41,6 +41,7 @@ import qualified Hydra.Yaml.Model as YamlModel import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | Convert a JSON value to a YAML node. Always succeeds since YAML is a superset of JSON.
src/main/haskell/Hydra/Languages.hs view
@@ -37,6 +37,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Language constraints for Hydra Core, i.e. no constraints. hydraLanguage :: Coders.Language
src/main/haskell/Hydra/Lexical.hs view
@@ -51,6 +51,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S @@ -82,7 +83,8 @@        let tryName =               \index ->-                let candidate = Logic.ifElse (Equality.equal index 1) name (Core.Name (Strings.concat2 (Core.unName name) (Literals.showInt32 index)))+                let candidate =+                        Logic.ifElse (Equality.equal index 1) name (Core.Name (Strings.concat2 (Core.unName name) (Literals.printInt32 index)))                 in (Logic.ifElse (Sets.member candidate reserved) (tryName (Math.add index 1)) candidate)       in (tryName 1) @@ -101,7 +103,7 @@                 _ -> Just (Core.TypeScheme {                   Core.typeSchemeVariables = [],                   Core.typeSchemeBody = t,-                  Core.typeSchemeConstraints = Nothing})+                  Core.typeSchemeConstraints = Maps.empty})       in (Optionals.bind (Maps.lookup name types) (\ts -> Optionals.map (\ts2 -> Core.TypeScheme {         Core.typeSchemeVariables = (Lists.concat2 (Core.typeSchemeVariables ts) (Core.typeSchemeVariables ts2)),         Core.typeSchemeBody = (Core.typeSchemeBody ts2),
src/main/haskell/Hydra/Lib/Chars.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  isAlpha :: Packaging.PrimitiveDefinition isAlpha =
src/main/haskell/Hydra/Lib/Defaults.hs view
@@ -7,6 +7,7 @@ import qualified Hydra.Core as Core import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | A map from primitive name to default (cross-compilable) reference implementation, for primitives which declare one. Each value is an encoded (reified) term; decode it to recover the executable implementation.@@ -396,12 +397,6 @@               Core.applicationArgument = (Core.TermPair (Core.TermList [], (Core.TermList [])))})),             Core.applicationArgument = (Core.TermVariable (Core.Name "xs"))}))}))),       (-        Core.Name "hydra.lib.eithers.pure",-        (Core.TermLambda (Core.Lambda {-          Core.lambdaParameter = (Core.Name "x"),-          Core.lambdaDomain = Nothing,-          Core.lambdaBody = (Core.TermEither (Right (Core.TermVariable (Core.Name "x"))))}))),-      (         Core.Name "hydra.lib.eithers.rights",         (Core.TermLambda (Core.Lambda {           Core.lambdaParameter = (Core.Name "xs"),@@ -676,7 +671,7 @@                               Core.applicationFunction = (Core.TermApplication (Core.Application {                                 Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.logic.and")),                                 Core.applicationArgument = (Core.TermApplication (Core.Application {-                                  Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.null")),+                                  Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.isEmpty")),                                   Core.applicationArgument = (Core.TermApplication (Core.Application {                                     Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.pairs.second")),                                     Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))}))}))})),@@ -1066,7 +1061,7 @@                                 Core.applicationArgument = (Core.TermVariable (Core.Name "x"))})),                               Core.applicationArgument = (Core.TermVariable (Core.Name "y"))}))}))}))}))}))})),                   Core.applicationArgument = (Core.TermApplication (Core.Application {-                    Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.pure")),+                    Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.given")),                     Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))}))})),                 Core.applicationArgument = (Core.TermVariable (Core.Name "xs"))}))}))}))}))),       (@@ -1190,7 +1185,7 @@                                   Core.applicationArgument = (Core.TermVariable (Core.Name "ys"))}))}))})),                             Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))}))}))}))}))}))})),                 Core.applicationArgument = (Core.TermApplication (Core.Application {-                  Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.pure")),+                  Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.given")),                   Core.applicationArgument = (Core.TermList [])}))})),               Core.applicationArgument = (Core.TermVariable (Core.Name "xs"))}))}))}))),       (@@ -1257,17 +1252,11 @@                                     Core.applicationArgument = (Core.TermVariable (Core.Name "ys"))}))}))})),                               Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))}))}))}))}))}))})),                   Core.applicationArgument = (Core.TermApplication (Core.Application {-                    Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.pure")),+                    Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.given")),                     Core.applicationArgument = (Core.TermList [])}))})),                 Core.applicationArgument = (Core.TermApplication (Core.Application {                   Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.toList")),                   Core.applicationArgument = (Core.TermVariable (Core.Name "s"))}))}))}))}))}))),-      (-        Core.Name "hydra.lib.optionals.pure",-        (Core.TermLambda (Core.Lambda {-          Core.lambdaParameter = (Core.Name "x"),-          Core.lambdaDomain = Nothing,-          Core.lambdaBody = (Core.TermOptional (Just (Core.TermVariable (Core.Name "x"))))}))),       (         Core.Name "hydra.lib.optionals.toList",         (Core.TermLambda (Core.Lambda {
src/main/haskell/Hydra/Lib/Effects.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  apply :: Packaging.PrimitiveDefinition apply =
src/main/haskell/Hydra/Lib/Eithers.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  apply :: Packaging.PrimitiveDefinition apply =@@ -331,9 +332,12 @@         Packaging.entityMetadataComments = [           "either(f, g, e) returns f(x) if e is Left x and g(y) if e is Right y.",           "The fundamental eliminator for the either type; every other primitive in this namespace can be derived from it.",-          "Total. Corresponds to Haskell's either :: (a -> c) -> (b -> c) -> Either a b -> c."],+          "Total. Corresponds to Haskell's either :: (a -> c) -> (b -> c) -> Either a b -> c.",+          "Deprecated since 0.18. Use: cases."],         Packaging.entityMetadataSeeAlso = [],-        Packaging.entityMetadataLifecycle = Nothing})),+        Packaging.entityMetadataLifecycle = (Just (Packaging.LifecycleInfo {+          Packaging.lifecycleInfoAvailableSince = Nothing,+          Packaging.lifecycleInfoDeprecatedSince = (Just (Packaging.Version "0.18"))}))})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {         Typing.termSignatureTypeParameters = [           Typing.TypeParameter {@@ -557,6 +561,40 @@               Core.lambdaBody = (Core.TermLiteral (Core.LiteralBoolean True))}))})),           Core.applicationArgument = (Core.TermVariable (Core.Name "e"))}))})))} +left :: Packaging.PrimitiveDefinition+left =+    Packaging.PrimitiveDefinition {+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.eithers.left"),+      Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+        Packaging.entityMetadataDescription = (Just "Construct a left (error/exceptional) either value."),+        Packaging.entityMetadataComments = [+          "left(x) is Left x. The dual constructor to right, injecting into the Left (error/exceptional) side of an either.",+          "Total. Corresponds to Haskell's Left :: a -> Either a b."],+        Packaging.entityMetadataSeeAlso = [],+        Packaging.entityMetadataLifecycle = Nothing})),+      Packaging.primitiveDefinitionSignature = Typing.TermSignature {+        Typing.termSignatureTypeParameters = [+          Typing.TypeParameter {+            Typing.typeParameterName = (Core.Name "x"),+            Typing.typeParameterConstraints = []},+          Typing.TypeParameter {+            Typing.typeParameterName = (Core.Name "y"),+            Typing.typeParameterConstraints = []}],+        Typing.termSignatureParameters = [+          Typing.Parameter {+            Typing.parameterName = (Core.Name "x"),+            Typing.parameterDescription = (Just "the value to wrap as a Left"),+            Typing.parameterType = (Core.TypeVariable (Core.Name "x")),+            Typing.parameterIsLazy = False}],+        Typing.termSignatureResult = Typing.Result {+          Typing.resultDescription = Nothing,+          Typing.resultType = (Core.TypeEither (Core.EitherType {+            Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "x")),+            Core.eitherTypeRight = (Core.TypeVariable (Core.Name "y"))}))}},+      Packaging.primitiveDefinitionIsPure = True,+      Packaging.primitiveDefinitionIsTotal = True,+      Packaging.primitiveDefinitionDefaultImplementation = Nothing}+ lefts :: Packaging.PrimitiveDefinition lefts =     Packaging.PrimitiveDefinition {@@ -851,6 +889,7 @@         Packaging.entityMetadataDescription = (Just "Map a function returning either over a set, collecting results or short-circuiting on Left."),         Packaging.entityMetadataComments = [           "mapSet(f, s) applies f to each element of s in unspecified order. If every application returns Right, the result is Right of the set of contained values (deduplicated by the result type's ordering); the first application returning Left short-circuits the whole result to that Left.",+          "Requires an 'ordering' constraint on the input and output element types.",           "Total. Corresponds to Haskell's traverse-style operation specialised to Set."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),@@ -858,10 +897,12 @@         Typing.termSignatureTypeParameters = [           Typing.TypeParameter {             Typing.typeParameterName = (Core.Name "x"),-            Typing.typeParameterConstraints = []},+            Typing.typeParameterConstraints = [+              Core.TypeClassConstraintSimple (Core.Name "ordering")]},           Typing.TypeParameter {             Typing.typeParameterName = (Core.Name "y"),-            Typing.typeParameterConstraints = []},+            Typing.typeParameterConstraints = [+              Core.TypeClassConstraintSimple (Core.Name "ordering")]},           Typing.TypeParameter {             Typing.typeParameterName = (Core.Name "z"),             Typing.typeParameterConstraints = []}],@@ -1021,16 +1062,15 @@             Core.applicationArgument = (Core.TermPair (Core.TermList [], (Core.TermList [])))})),           Core.applicationArgument = (Core.TermVariable (Core.Name "xs"))}))})))} -pure :: Packaging.PrimitiveDefinition-pure =+right :: Packaging.PrimitiveDefinition+right =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.eithers.pure"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.eithers.right"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Wrap a value as a right."),+        Packaging.entityMetadataDescription = (Just "Construct a right (success/normal) either value."),         Packaging.entityMetadataComments = [-          "pure(x) is right(x); this defining equation is the specification, and the default implementation.",-          "This is the unit of the either monad; it exists so that code written generically over a monad can reach the unit.",-          "Total. Corresponds to Haskell's pure / Right for Either."],+          "right(x) is Right x. The dual constructor to left, injecting into the Right (success/normal) side of an either.",+          "Total. Corresponds to Haskell's Right :: b -> Either a b."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {@@ -1054,10 +1094,7 @@             Core.eitherTypeRight = (Core.TypeVariable (Core.Name "y"))}))}},       Packaging.primitiveDefinitionIsPure = True,       Packaging.primitiveDefinitionIsTotal = True,-      Packaging.primitiveDefinitionDefaultImplementation = (Just (Core.TermLambda (Core.Lambda {-        Core.lambdaParameter = (Core.Name "x"),-        Core.lambdaDomain = Nothing,-        Core.lambdaBody = (Core.TermEither (Right (Core.TermVariable (Core.Name "x"))))})))}+      Packaging.primitiveDefinitionDefaultImplementation = Nothing}  rights :: Packaging.PrimitiveDefinition rights =
src/main/haskell/Hydra/Lib/Equality.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  equal :: Packaging.PrimitiveDefinition equal =
src/main/haskell/Hydra/Lib/Files.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  appendFile :: Packaging.PrimitiveDefinition appendFile =@@ -75,9 +76,12 @@       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {         Packaging.entityMetadataDescription = (Just "Copy a file, or a directory tree, to a destination path."),         Packaging.entityMetadataComments = [-          "copy(recursive, source, destination) describes an effectful computation which attempts to copy source to destination. When recursive is false, source must be a single file. When recursive is true, source may be a directory, whose entire tree is copied. Copying is performed by the host operating system rather than by reading and rewriting contents, preserving binary data and avoiding a round trip through the language runtime. A recoverable file-system failure is returned as left(error); success is returned as right(unit)."],+          "copy(recursive, source, destination) describes an effectful computation which attempts to copy source to destination. When recursive is false, source must be a single file. When recursive is true, source may be a directory, whose entire tree is copied. Copying is performed by the host operating system rather than by reading and rewriting contents, preserving binary data and avoiding a round trip through the language runtime. A recoverable file-system failure is returned as left(error); success is returned as right(unit).",+          "Deprecated since 0.18. Use: copyFile."],         Packaging.entityMetadataSeeAlso = [],-        Packaging.entityMetadataLifecycle = Nothing})),+        Packaging.entityMetadataLifecycle = (Just (Packaging.LifecycleInfo {+          Packaging.lifecycleInfoAvailableSince = Nothing,+          Packaging.lifecycleInfoDeprecatedSince = (Just (Packaging.Version "0.18"))}))})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {         Typing.termSignatureTypeParameters = [],         Typing.termSignatureParameters = [
src/main/haskell/Hydra/Lib/Functions.hs view
@@ -35,6 +35,38 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void++absurd :: Packaging.PrimitiveDefinition+absurd =+    Packaging.PrimitiveDefinition {+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.functions.absurd"),+      Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+        Packaging.entityMetadataDescription = (Just "Eliminate a value of the uninhabited void type, producing any type."),+        Packaging.entityMetadataComments = [+          "absurd(v) is the unique function from void to any type t1; since void has no inhabitants, this function can never actually be applied in a well-typed program.",+          "Its purpose is to discharge an impossible branch in otherwise-total code, such as the left case of an either<void, a> that can never occur.",+          "The eliminator dual to the (nonexistent) introducer for void.",+          "Total, vacuously: there is no well-typed argument on which absurd could be called. Corresponds to Haskell's Data.Void.absurd :: Void -> a."],+        Packaging.entityMetadataSeeAlso = [],+        Packaging.entityMetadataLifecycle = Nothing})),+      Packaging.primitiveDefinitionSignature = Typing.TermSignature {+        Typing.termSignatureTypeParameters = [+          Typing.TypeParameter {+            Typing.typeParameterName = (Core.Name "t1"),+            Typing.typeParameterConstraints = []}],+        Typing.termSignatureParameters = [+          Typing.Parameter {+            Typing.parameterName = (Core.Name "v"),+            Typing.parameterDescription = (Just "a value of the void type; unreachable in any well-typed program"),+            Typing.parameterType = Core.TypeVoid,+            Typing.parameterIsLazy = False}],+        Typing.termSignatureResult = Typing.Result {+          Typing.resultDescription = Nothing,+          Typing.resultType = (Core.TypeVariable (Core.Name "t1"))}},+      Packaging.primitiveDefinitionIsPure = True,+      Packaging.primitiveDefinitionIsTotal = True,+      Packaging.primitiveDefinitionDefaultImplementation = Nothing}  compose :: Packaging.PrimitiveDefinition compose =
src/main/haskell/Hydra/Lib/Hashing.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  sha256 :: Packaging.PrimitiveDefinition sha256 =
src/main/haskell/Hydra/Lib/Lists.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  apply :: Packaging.PrimitiveDefinition apply =@@ -568,7 +569,7 @@         Packaging.entityMetadataDescription = (Just "Left-fold a list in the list monad (a nondeterministic fold)."),         Packaging.entityMetadataComments = [           "foldList(f, acc0, xs) folds xs from the left, branching the accumulator over every result of the step function at each element: after each element the set of accumulators is replaced by all results of applying f to each current accumulator and that element.",-          "foldList(f, acc0, xs) is foldl(\\macc el -> bind(macc, \\acc -> f(acc, el)), pure(acc0), xs); this defining equation is the specification. For the empty list the result is pure(acc0).",+          "foldList(f, acc0, xs) is foldl(\\macc el -> bind(macc, \\acc -> f(acc, el)), singleton(acc0), xs); this defining equation is the specification. For the empty list the result is singleton(acc0).",           "Total on finite inputs. The list-monad instance of the monadic left fold."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),@@ -823,6 +824,35 @@       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} +isEmpty :: Packaging.PrimitiveDefinition+isEmpty =+    Packaging.PrimitiveDefinition {+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.lists.isEmpty"),+      Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+        Packaging.entityMetadataDescription = (Just "Test whether a list is empty."),+        Packaging.entityMetadataComments = [+          "isEmpty(xs) returns true iff xs is the empty list.",+          "Total. Corresponds to Haskell's null :: [a] -> Bool."],+        Packaging.entityMetadataSeeAlso = [],+        Packaging.entityMetadataLifecycle = Nothing})),+      Packaging.primitiveDefinitionSignature = Typing.TermSignature {+        Typing.termSignatureTypeParameters = [+          Typing.TypeParameter {+            Typing.typeParameterName = (Core.Name "x"),+            Typing.typeParameterConstraints = []}],+        Typing.termSignatureParameters = [+          Typing.Parameter {+            Typing.parameterName = (Core.Name "xs"),+            Typing.parameterDescription = (Just "the list to test"),+            Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))),+            Typing.parameterIsLazy = False}],+        Typing.termSignatureResult = Typing.Result {+          Typing.resultDescription = Nothing,+          Typing.resultType = (Core.TypeLiteral Core.LiteralTypeBoolean)}},+      Packaging.primitiveDefinitionIsPure = True,+      Packaging.primitiveDefinitionIsTotal = True,+      Packaging.primitiveDefinitionDefaultImplementation = Nothing}+ join :: Packaging.PrimitiveDefinition join =     Packaging.PrimitiveDefinition {@@ -963,7 +993,7 @@         Packaging.entityMetadataDescription = (Just "Traverse a list in the list monad."),         Packaging.entityMetadataComments = [           "mapList(f, xs) returns all combinations obtainable by choosing one element from f(x) for each x in xs: each result list has the same length as xs, with its element at each position drawn from the corresponding f(x).",-          "Results appear in the lexicographic order of the choices, with the choice for the first element varying slowest. The number of results is the product of the lengths of the lists f(x); if f(x) is empty for any element, the result is the empty list; mapList(f, []) is pure([]).",+          "Results appear in the lexicographic order of the choices, with the choice for the first element varying slowest. The number of results is the product of the lengths of the lists f(x); if f(x) is empty for any element, the result is the empty list; mapList(f, []) is singleton([]).",           "Total on finite inputs. The list-monad instance of the traversal family."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),@@ -1112,35 +1142,6 @@       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -null :: Packaging.PrimitiveDefinition-null =-    Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.lists.null"),-      Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Test whether a list is empty."),-        Packaging.entityMetadataComments = [-          "null(xs) returns true iff xs is the empty list.",-          "Total. Corresponds to Haskell's null :: [a] -> Bool."],-        Packaging.entityMetadataSeeAlso = [],-        Packaging.entityMetadataLifecycle = Nothing})),-      Packaging.primitiveDefinitionSignature = Typing.TermSignature {-        Typing.termSignatureTypeParameters = [-          Typing.TypeParameter {-            Typing.typeParameterName = (Core.Name "x"),-            Typing.typeParameterConstraints = []}],-        Typing.termSignatureParameters = [-          Typing.Parameter {-            Typing.parameterName = (Core.Name "xs"),-            Typing.parameterDescription = (Just "the list to test"),-            Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))),-            Typing.parameterIsLazy = False}],-        Typing.termSignatureResult = Typing.Result {-          Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeLiteral Core.LiteralTypeBoolean)}},-      Packaging.primitiveDefinitionIsPure = True,-      Packaging.primitiveDefinitionIsTotal = True,-      Packaging.primitiveDefinitionDefaultImplementation = Nothing}- partition :: Packaging.PrimitiveDefinition partition =     Packaging.PrimitiveDefinition {@@ -1225,35 +1226,6 @@               Core.applicationArgument = (Core.TermPair (Core.TermList [], (Core.TermList [])))})),             Core.applicationArgument = (Core.TermVariable (Core.Name "xs"))}))}))})))} -pure :: Packaging.PrimitiveDefinition-pure =-    Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.lists.pure"),-      Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Wrap a value in a single-element list."),-        Packaging.entityMetadataComments = [-          "pure(x) = [x]. The applicative pure for lists.",-          "Total. Corresponds to Haskell's pure :: a -> [a]."],-        Packaging.entityMetadataSeeAlso = [],-        Packaging.entityMetadataLifecycle = Nothing})),-      Packaging.primitiveDefinitionSignature = Typing.TermSignature {-        Typing.termSignatureTypeParameters = [-          Typing.TypeParameter {-            Typing.typeParameterName = (Core.Name "x"),-            Typing.typeParameterConstraints = []}],-        Typing.termSignatureParameters = [-          Typing.Parameter {-            Typing.parameterName = (Core.Name "x"),-            Typing.parameterDescription = (Just "the value to wrap"),-            Typing.parameterType = (Core.TypeVariable (Core.Name "x")),-            Typing.parameterIsLazy = False}],-        Typing.termSignatureResult = Typing.Result {-          Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeList (Core.TypeVariable (Core.Name "x")))}},-      Packaging.primitiveDefinitionIsPure = True,-      Packaging.primitiveDefinitionIsTotal = True,-      Packaging.primitiveDefinitionDefaultImplementation = Nothing}- replicate :: Packaging.PrimitiveDefinition replicate =     Packaging.PrimitiveDefinition {@@ -1324,7 +1296,8 @@       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {         Packaging.entityMetadataDescription = (Just "Construct a single-element list."),         Packaging.entityMetadataComments = [-          "singleton(x) = [x]. Identical to pure for lists.",+          "singleton(x) = [x].",+          "The constructor for a single-element list; useful point-free (e.g. map singleton xs).",           "Total. Corresponds to Haskell's singleton :: a -> [a]."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),@@ -1478,7 +1451,7 @@                             Core.applicationFunction = (Core.TermApplication (Core.Application {                               Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.logic.and")),                               Core.applicationArgument = (Core.TermApplication (Core.Application {-                                Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.null")),+                                Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.isEmpty")),                                 Core.applicationArgument = (Core.TermApplication (Core.Application {                                   Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.pairs.second")),                                   Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))}))}))})),
src/main/haskell/Hydra/Lib/Literals.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  base64ToBinary :: Packaging.PrimitiveDefinition base64ToBinary =@@ -635,14 +636,15 @@       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -parseBoolean :: Packaging.PrimitiveDefinition-parseBoolean =+parseBigint :: Packaging.PrimitiveDefinition+parseBigint =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.parseBoolean"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.parseBigint"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Parse a string as a boolean."),+        Packaging.entityMetadataDescription = (Just "Parse a string as a bigint."),         Packaging.entityMetadataComments = [-          "parseBoolean(s) returns Just(true) for \"true\", Just(false) for \"false\", and Nothing for any other input (including \"True\"/\"False\" with capital initial letter on some hosts; behavior on capitalized forms is host-defined and should not be relied upon).",+          "parseBigint(s) returns Just(x) where x is the bigint parsed from s, or Nothing if s is not a valid bigint literal.",+          "Accepted syntax follows the Haskell Show/Read convention: an optional leading minus sign followed by a sequence of decimal digits. Whitespace is not stripped; leading or trailing whitespace causes parse failure.",           "Total."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),@@ -656,20 +658,20 @@             Typing.parameterIsLazy = False}],         Typing.termSignatureResult = Typing.Result {           Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral Core.LiteralTypeBoolean))}},+          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeBigint)))}},       Packaging.primitiveDefinitionIsPure = True,       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -parseString :: Packaging.PrimitiveDefinition-parseString =+parseBoolean :: Packaging.PrimitiveDefinition+parseBoolean =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.parseString"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.parseBoolean"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Parse a string-literal token to a plain string (Just) or Nothing on parse failure."),+        Packaging.entityMetadataDescription = (Just "Parse a string as a boolean."),         Packaging.entityMetadataComments = [-          "parseString(s) parses s as a Haskell-syntax string literal token: an opening double-quote, escaped characters per the Haskell lexical grammar (backslash escapes for special characters and Unicode code points), and a closing double-quote. Returns Just of the decoded payload on success or Nothing on malformed input.",-          "Total. The inverse of printString."],+          "parseBoolean(s) returns Just(true) for \"true\", Just(false) for \"false\", and Nothing for any other input (including \"True\"/\"False\" with capital initial letter on some hosts; behavior on capitalized forms is host-defined and should not be relied upon).",+          "Total."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {@@ -677,51 +679,26 @@         Typing.termSignatureParameters = [           Typing.Parameter {             Typing.parameterName = (Core.Name "s"),-            Typing.parameterDescription = (Just "the string-literal token to parse"),+            Typing.parameterDescription = (Just "the string to parse"),             Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString),             Typing.parameterIsLazy = False}],         Typing.termSignatureResult = Typing.Result {           Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral Core.LiteralTypeString))}},-      Packaging.primitiveDefinitionIsPure = True,-      Packaging.primitiveDefinitionIsTotal = True,-      Packaging.primitiveDefinitionDefaultImplementation = Nothing}--printBoolean :: Packaging.PrimitiveDefinition-printBoolean =-    Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.printBoolean"),-      Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Render a boolean as a string."),-        Packaging.entityMetadataComments = [-          "printBoolean(true) = \"true\"; printBoolean(false) = \"false\".",-          "Total. The inverse of parseBoolean."],-        Packaging.entityMetadataSeeAlso = [],-        Packaging.entityMetadataLifecycle = Nothing})),-      Packaging.primitiveDefinitionSignature = Typing.TermSignature {-        Typing.termSignatureTypeParameters = [],-        Typing.termSignatureParameters = [-          Typing.Parameter {-            Typing.parameterName = (Core.Name "b"),-            Typing.parameterDescription = (Just "the boolean to render"),-            Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBoolean),-            Typing.parameterIsLazy = False}],-        Typing.termSignatureResult = Typing.Result {-          Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeLiteral Core.LiteralTypeString)}},+          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral Core.LiteralTypeBoolean))}},       Packaging.primitiveDefinitionIsPure = True,       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -printString :: Packaging.PrimitiveDefinition-printString =+parseDecimal :: Packaging.PrimitiveDefinition+parseDecimal =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.printString"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.parseDecimal"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Render a string as a string-literal token (escaped and quoted)."),+        Packaging.entityMetadataDescription = (Just "Parse a string as a decimal."),         Packaging.entityMetadataComments = [-          "printString(s) returns a Haskell-syntax string literal token representing s: an opening double-quote, the characters of s with special characters escaped (backslash sequences for control characters, quotes, and non-printable Unicode code points), and a closing double-quote.",-          "Total. The inverse of parseString."],+          "parseDecimal(s) returns Just(x) where x is the decimal parsed from s, or Nothing on parse failure.",+          "Accepted syntax is the standard decimal literal: an optional sign, an integer part, an optional fractional part, and an optional exponent (e.g. -1.5, 2e10, 0.0).",+          "Total."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {@@ -729,25 +706,25 @@         Typing.termSignatureParameters = [           Typing.Parameter {             Typing.parameterName = (Core.Name "s"),-            Typing.parameterDescription = (Just "the string to render"),+            Typing.parameterDescription = (Just "the string to parse"),             Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString),             Typing.parameterIsLazy = False}],         Typing.termSignatureResult = Typing.Result {           Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeLiteral Core.LiteralTypeString)}},+          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral Core.LiteralTypeDecimal))}},       Packaging.primitiveDefinitionIsPure = True,       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -readBigint :: Packaging.PrimitiveDefinition-readBigint =+parseFloat32 :: Packaging.PrimitiveDefinition+parseFloat32 =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.readBigint"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.parseFloat32"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Parse a string as a bigint."),+        Packaging.entityMetadataDescription = (Just "Parse a string as a float32."),         Packaging.entityMetadataComments = [-          "readBigint(s) returns Just(x) where x is the bigint parsed from s, or Nothing if s is not a valid bigint literal.",-          "Accepted syntax follows the Haskell Show/Read convention: an optional leading minus sign followed by a sequence of decimal digits. Whitespace is not stripped; leading or trailing whitespace causes parse failure.",+          "parseFloat32(s) returns Just(x) where x is the IEEE 754 binary32 value closest to the number parsed from s under roundTiesToEven, or Nothing on parse failure.",+          "Accepted special-value literals (\"NaN\", \"Infinity\", \"-Infinity\", etc.) and their capitalization are host-defined.",           "Total."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),@@ -761,20 +738,20 @@             Typing.parameterIsLazy = False}],         Typing.termSignatureResult = Typing.Result {           Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeBigint)))}},+          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat32)))}},       Packaging.primitiveDefinitionIsPure = True,       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -readDecimal :: Packaging.PrimitiveDefinition-readDecimal =+parseFloat64 :: Packaging.PrimitiveDefinition+parseFloat64 =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.readDecimal"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.parseFloat64"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Parse a string as a decimal."),+        Packaging.entityMetadataDescription = (Just "Parse a string as a float64."),         Packaging.entityMetadataComments = [-          "readDecimal(s) returns Just(x) where x is the decimal parsed from s, or Nothing on parse failure.",-          "Accepted syntax is the standard decimal literal: an optional sign, an integer part, an optional fractional part, and an optional exponent (e.g. -1.5, 2e10, 0.0).",+          "parseFloat64(s) returns Just(x) where x is the IEEE 754 binary64 value closest to the number parsed from s under roundTiesToEven, or Nothing on parse failure.",+          "Accepted special-value literals (\"NaN\", \"Infinity\", \"-Infinity\", etc.) and their capitalization are host-defined.",           "Total."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),@@ -788,20 +765,19 @@             Typing.parameterIsLazy = False}],         Typing.termSignatureResult = Typing.Result {           Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral Core.LiteralTypeDecimal))}},+          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)))}},       Packaging.primitiveDefinitionIsPure = True,       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -readFloat32 :: Packaging.PrimitiveDefinition-readFloat32 =+parseInt16 :: Packaging.PrimitiveDefinition+parseInt16 =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.readFloat32"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.parseInt16"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Parse a string as a float32."),+        Packaging.entityMetadataDescription = (Just "Parse a string as an int16."),         Packaging.entityMetadataComments = [-          "readFloat32(s) returns Just(x) where x is the IEEE 754 binary32 value closest to the number parsed from s under roundTiesToEven, or Nothing on parse failure.",-          "Accepted special-value literals (\"NaN\", \"Infinity\", \"-Infinity\", etc.) and their capitalization are host-defined.",+          "parseInt16(s) returns Just(x) where x is the int16 parsed from s, or Nothing if s is not a valid integer literal or the parsed value is outside [-2^15, 2^15-1].",           "Total."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),@@ -815,20 +791,19 @@             Typing.parameterIsLazy = False}],         Typing.termSignatureResult = Typing.Result {           Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat32)))}},+          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt16)))}},       Packaging.primitiveDefinitionIsPure = True,       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -readFloat64 :: Packaging.PrimitiveDefinition-readFloat64 =+parseInt32 :: Packaging.PrimitiveDefinition+parseInt32 =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.readFloat64"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.parseInt32"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Parse a string as a float64."),+        Packaging.entityMetadataDescription = (Just "Parse a string as an int32."),         Packaging.entityMetadataComments = [-          "readFloat64(s) returns Just(x) where x is the IEEE 754 binary64 value closest to the number parsed from s under roundTiesToEven, or Nothing on parse failure.",-          "Accepted special-value literals (\"NaN\", \"Infinity\", \"-Infinity\", etc.) and their capitalization are host-defined.",+          "parseInt32(s) returns Just(x) where x is the int32 parsed from s, or Nothing if s is not a valid integer literal or the parsed value is outside [-2^31, 2^31-1].",           "Total."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),@@ -842,19 +817,19 @@             Typing.parameterIsLazy = False}],         Typing.termSignatureResult = Typing.Result {           Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)))}},+          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)))}},       Packaging.primitiveDefinitionIsPure = True,       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -readInt16 :: Packaging.PrimitiveDefinition-readInt16 =+parseInt64 :: Packaging.PrimitiveDefinition+parseInt64 =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.readInt16"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.parseInt64"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Parse a string as an int16."),+        Packaging.entityMetadataDescription = (Just "Parse a string as an int64."),         Packaging.entityMetadataComments = [-          "readInt16(s) returns Just(x) where x is the int16 parsed from s, or Nothing if s is not a valid integer literal or the parsed value is outside [-2^15, 2^15-1].",+          "parseInt64(s) returns Just(x) where x is the int64 parsed from s, or Nothing if s is not a valid integer literal or the parsed value is outside [-2^63, 2^63-1].",           "Total."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),@@ -868,19 +843,19 @@             Typing.parameterIsLazy = False}],         Typing.termSignatureResult = Typing.Result {           Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt16)))}},+          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt64)))}},       Packaging.primitiveDefinitionIsPure = True,       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -readInt32 :: Packaging.PrimitiveDefinition-readInt32 =+parseInt8 :: Packaging.PrimitiveDefinition+parseInt8 =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.readInt32"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.parseInt8"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Parse a string as an int32."),+        Packaging.entityMetadataDescription = (Just "Parse a string as an int8."),         Packaging.entityMetadataComments = [-          "readInt32(s) returns Just(x) where x is the int32 parsed from s, or Nothing if s is not a valid integer literal or the parsed value is outside [-2^31, 2^31-1].",+          "parseInt8(s) returns Just(x) where x is the int8 parsed from s, or Nothing if s is not a valid integer literal or the parsed value is outside [-128, 127].",           "Total."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),@@ -894,20 +869,20 @@             Typing.parameterIsLazy = False}],         Typing.termSignatureResult = Typing.Result {           Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)))}},+          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt8)))}},       Packaging.primitiveDefinitionIsPure = True,       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -readInt64 :: Packaging.PrimitiveDefinition-readInt64 =+parseString :: Packaging.PrimitiveDefinition+parseString =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.readInt64"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.parseString"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Parse a string as an int64."),+        Packaging.entityMetadataDescription = (Just "Parse a string-literal token to a plain string (Just) or Nothing on parse failure."),         Packaging.entityMetadataComments = [-          "readInt64(s) returns Just(x) where x is the int64 parsed from s, or Nothing if s is not a valid integer literal or the parsed value is outside [-2^63, 2^63-1].",-          "Total."],+          "parseString(s) parses s as a Haskell-syntax string literal token: an opening double-quote, escaped characters per the Haskell lexical grammar (backslash escapes for special characters and Unicode code points), and a closing double-quote. Returns Just of the decoded payload on success or Nothing on malformed input.",+          "Total. The inverse of printString."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {@@ -915,24 +890,24 @@         Typing.termSignatureParameters = [           Typing.Parameter {             Typing.parameterName = (Core.Name "s"),-            Typing.parameterDescription = (Just "the string to parse"),+            Typing.parameterDescription = (Just "the string-literal token to parse"),             Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString),             Typing.parameterIsLazy = False}],         Typing.termSignatureResult = Typing.Result {           Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt64)))}},+          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral Core.LiteralTypeString))}},       Packaging.primitiveDefinitionIsPure = True,       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -readInt8 :: Packaging.PrimitiveDefinition-readInt8 =+parseUint16 :: Packaging.PrimitiveDefinition+parseUint16 =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.readInt8"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.parseUint16"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Parse a string as an int8."),+        Packaging.entityMetadataDescription = (Just "Parse a string as a uint16."),         Packaging.entityMetadataComments = [-          "readInt8(s) returns Just(x) where x is the int8 parsed from s, or Nothing if s is not a valid integer literal or the parsed value is outside [-128, 127].",+          "parseUint16(s) returns Just(x) where x is the uint16 parsed from s, or Nothing if s is not a valid non-negative integer literal or the parsed value is outside [0, 2^16-1].",           "Total."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),@@ -946,19 +921,19 @@             Typing.parameterIsLazy = False}],         Typing.termSignatureResult = Typing.Result {           Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt8)))}},+          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeUint16)))}},       Packaging.primitiveDefinitionIsPure = True,       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -readUint16 :: Packaging.PrimitiveDefinition-readUint16 =+parseUint32 :: Packaging.PrimitiveDefinition+parseUint32 =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.readUint16"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.parseUint32"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Parse a string as a uint16."),+        Packaging.entityMetadataDescription = (Just "Parse a string as a uint32."),         Packaging.entityMetadataComments = [-          "readUint16(s) returns Just(x) where x is the uint16 parsed from s, or Nothing if s is not a valid non-negative integer literal or the parsed value is outside [0, 2^16-1].",+          "parseUint32(s) returns Just(x) where x is the uint32 parsed from s, or Nothing if s is not a valid non-negative integer literal or the parsed value is outside [0, 2^32-1].",           "Total."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),@@ -972,19 +947,19 @@             Typing.parameterIsLazy = False}],         Typing.termSignatureResult = Typing.Result {           Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeUint16)))}},+          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeUint32)))}},       Packaging.primitiveDefinitionIsPure = True,       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -readUint32 :: Packaging.PrimitiveDefinition-readUint32 =+parseUint64 :: Packaging.PrimitiveDefinition+parseUint64 =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.readUint32"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.parseUint64"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Parse a string as a uint32."),+        Packaging.entityMetadataDescription = (Just "Parse a string as a uint64."),         Packaging.entityMetadataComments = [-          "readUint32(s) returns Just(x) where x is the uint32 parsed from s, or Nothing if s is not a valid non-negative integer literal or the parsed value is outside [0, 2^32-1].",+          "parseUint64(s) returns Just(x) where x is the uint64 parsed from s, or Nothing if s is not a valid non-negative integer literal or the parsed value is outside [0, 2^64-1].",           "Total."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),@@ -998,19 +973,19 @@             Typing.parameterIsLazy = False}],         Typing.termSignatureResult = Typing.Result {           Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeUint32)))}},+          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeUint64)))}},       Packaging.primitiveDefinitionIsPure = True,       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -readUint64 :: Packaging.PrimitiveDefinition-readUint64 =+parseUint8 :: Packaging.PrimitiveDefinition+parseUint8 =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.readUint64"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.parseUint8"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Parse a string as a uint64."),+        Packaging.entityMetadataDescription = (Just "Parse a string as a uint8."),         Packaging.entityMetadataComments = [-          "readUint64(s) returns Just(x) where x is the uint64 parsed from s, or Nothing if s is not a valid non-negative integer literal or the parsed value is outside [0, 2^64-1].",+          "parseUint8(s) returns Just(x) where x is the uint8 parsed from s, or Nothing if s is not a valid non-negative integer literal or the parsed value is outside [0, 255].",           "Total."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),@@ -1024,55 +999,55 @@             Typing.parameterIsLazy = False}],         Typing.termSignatureResult = Typing.Result {           Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeUint64)))}},+          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeUint8)))}},       Packaging.primitiveDefinitionIsPure = True,       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -readUint8 :: Packaging.PrimitiveDefinition-readUint8 =+printBigint :: Packaging.PrimitiveDefinition+printBigint =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.readUint8"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.printBigint"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Parse a string as a uint8."),+        Packaging.entityMetadataDescription = (Just "Render a bigint as a string."),         Packaging.entityMetadataComments = [-          "readUint8(s) returns Just(x) where x is the uint8 parsed from s, or Nothing if s is not a valid non-negative integer literal or the parsed value is outside [0, 255].",-          "Total."],+          "printBigint(x) returns the canonical decimal representation of x: an optional leading minus sign followed by decimal digits. No leading zeros are produced (except for the value 0 itself, which renders as \"0\").",+          "Total. The inverse of parseBigint."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {         Typing.termSignatureTypeParameters = [],         Typing.termSignatureParameters = [           Typing.Parameter {-            Typing.parameterName = (Core.Name "s"),-            Typing.parameterDescription = (Just "the string to parse"),-            Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString),+            Typing.parameterName = (Core.Name "x"),+            Typing.parameterDescription = (Just "the bigint to render"),+            Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeBigint)),             Typing.parameterIsLazy = False}],         Typing.termSignatureResult = Typing.Result {           Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeUint8)))}},+          Typing.resultType = (Core.TypeLiteral Core.LiteralTypeString)}},       Packaging.primitiveDefinitionIsPure = True,       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -showBigint :: Packaging.PrimitiveDefinition-showBigint =+printBoolean :: Packaging.PrimitiveDefinition+printBoolean =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.showBigint"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.printBoolean"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Render a bigint as a string."),+        Packaging.entityMetadataDescription = (Just "Render a boolean as a string."),         Packaging.entityMetadataComments = [-          "showBigint(x) returns the canonical decimal representation of x: an optional leading minus sign followed by decimal digits. No leading zeros are produced (except for the value 0 itself, which renders as \"0\").",-          "Total. The inverse of readBigint."],+          "printBoolean(true) = \"true\"; printBoolean(false) = \"false\".",+          "Total. The inverse of parseBoolean."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {         Typing.termSignatureTypeParameters = [],         Typing.termSignatureParameters = [           Typing.Parameter {-            Typing.parameterName = (Core.Name "x"),-            Typing.parameterDescription = (Just "the bigint to render"),-            Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeBigint)),+            Typing.parameterName = (Core.Name "b"),+            Typing.parameterDescription = (Just "the boolean to render"),+            Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBoolean),             Typing.parameterIsLazy = False}],         Typing.termSignatureResult = Typing.Result {           Typing.resultDescription = Nothing,@@ -1081,14 +1056,14 @@       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -showDecimal :: Packaging.PrimitiveDefinition-showDecimal =+printDecimal :: Packaging.PrimitiveDefinition+printDecimal =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.showDecimal"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.printDecimal"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {         Packaging.entityMetadataDescription = (Just "Render a decimal as a string."),         Packaging.entityMetadataComments = [-          "showDecimal(x) returns the canonical decimal representation of x as a string. The exact form (use of scientific notation, trailing zeros, etc.) is host-defined but always round-trips with readDecimal.",+          "printDecimal(x) returns the canonical decimal representation of x as a string. The exact form (use of scientific notation, trailing zeros, etc.) is host-defined but always round-trips with parseDecimal.",           "Total."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),@@ -1107,14 +1082,14 @@       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -showFloat32 :: Packaging.PrimitiveDefinition-showFloat32 =+printFloat32 :: Packaging.PrimitiveDefinition+printFloat32 =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.showFloat32"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.printFloat32"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {         Packaging.entityMetadataDescription = (Just "Render a float32 as a string."),         Packaging.entityMetadataComments = [-          "showFloat32(x) returns a string representation of x. Finite values use the shortest decimal that round-trips through readFloat32 back to x. Special values render as \"NaN\", \"Infinity\", or \"-Infinity\" (capitalization is host-defined).",+          "printFloat32(x) returns a string representation of x. Finite values use the shortest decimal that round-trips through parseFloat32 back to x. Special values render as \"NaN\", \"Infinity\", or \"-Infinity\" (capitalization is host-defined).",           "Total."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),@@ -1133,14 +1108,14 @@       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -showFloat64 :: Packaging.PrimitiveDefinition-showFloat64 =+printFloat64 :: Packaging.PrimitiveDefinition+printFloat64 =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.showFloat64"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.printFloat64"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {         Packaging.entityMetadataDescription = (Just "Render a float64 as a string."),         Packaging.entityMetadataComments = [-          "showFloat64(x) returns a string representation of x. Finite values use the shortest decimal that round-trips through readFloat64 back to x. Special values render as \"NaN\", \"Infinity\", or \"-Infinity\" (capitalization is host-defined).",+          "printFloat64(x) returns a string representation of x. Finite values use the shortest decimal that round-trips through parseFloat64 back to x. Special values render as \"NaN\", \"Infinity\", or \"-Infinity\" (capitalization is host-defined).",           "Total."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),@@ -1159,15 +1134,15 @@       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -showInt16 :: Packaging.PrimitiveDefinition-showInt16 =+printInt16 :: Packaging.PrimitiveDefinition+printInt16 =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.showInt16"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.printInt16"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {         Packaging.entityMetadataDescription = (Just "Render an int16 as a string."),         Packaging.entityMetadataComments = [-          "showInt16(x) returns the canonical decimal representation of x: an optional leading minus sign followed by decimal digits.",-          "Total. The inverse of readInt16."],+          "printInt16(x) returns the canonical decimal representation of x: an optional leading minus sign followed by decimal digits.",+          "Total. The inverse of parseInt16."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {@@ -1185,15 +1160,15 @@       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -showInt32 :: Packaging.PrimitiveDefinition-showInt32 =+printInt32 :: Packaging.PrimitiveDefinition+printInt32 =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.showInt32"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.printInt32"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {         Packaging.entityMetadataDescription = (Just "Render an int32 as a string."),         Packaging.entityMetadataComments = [-          "showInt32(x) returns the canonical decimal representation of x: an optional leading minus sign followed by decimal digits.",-          "Total. The inverse of readInt32."],+          "printInt32(x) returns the canonical decimal representation of x: an optional leading minus sign followed by decimal digits.",+          "Total. The inverse of parseInt32."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {@@ -1211,15 +1186,15 @@       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -showInt64 :: Packaging.PrimitiveDefinition-showInt64 =+printInt64 :: Packaging.PrimitiveDefinition+printInt64 =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.showInt64"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.printInt64"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {         Packaging.entityMetadataDescription = (Just "Render an int64 as a string."),         Packaging.entityMetadataComments = [-          "showInt64(x) returns the canonical decimal representation of x: an optional leading minus sign followed by decimal digits.",-          "Total. The inverse of readInt64."],+          "printInt64(x) returns the canonical decimal representation of x: an optional leading minus sign followed by decimal digits.",+          "Total. The inverse of parseInt64."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {@@ -1237,15 +1212,15 @@       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -showInt8 :: Packaging.PrimitiveDefinition-showInt8 =+printInt8 :: Packaging.PrimitiveDefinition+printInt8 =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.showInt8"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.printInt8"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {         Packaging.entityMetadataDescription = (Just "Render an int8 as a string."),         Packaging.entityMetadataComments = [-          "showInt8(x) returns the canonical decimal representation of x: an optional leading minus sign followed by decimal digits.",-          "Total. The inverse of readInt8."],+          "printInt8(x) returns the canonical decimal representation of x: an optional leading minus sign followed by decimal digits.",+          "Total. The inverse of parseInt8."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {@@ -1263,15 +1238,41 @@       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -showUint16 :: Packaging.PrimitiveDefinition-showUint16 =+printString :: Packaging.PrimitiveDefinition+printString =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.showUint16"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.printString"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+        Packaging.entityMetadataDescription = (Just "Render a string as a string-literal token (escaped and quoted)."),+        Packaging.entityMetadataComments = [+          "printString(s) returns a Haskell-syntax string literal token representing s: an opening double-quote, the characters of s with special characters escaped (backslash sequences for control characters, quotes, and non-printable Unicode code points), and a closing double-quote.",+          "Total. The inverse of parseString."],+        Packaging.entityMetadataSeeAlso = [],+        Packaging.entityMetadataLifecycle = Nothing})),+      Packaging.primitiveDefinitionSignature = Typing.TermSignature {+        Typing.termSignatureTypeParameters = [],+        Typing.termSignatureParameters = [+          Typing.Parameter {+            Typing.parameterName = (Core.Name "s"),+            Typing.parameterDescription = (Just "the string to render"),+            Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString),+            Typing.parameterIsLazy = False}],+        Typing.termSignatureResult = Typing.Result {+          Typing.resultDescription = Nothing,+          Typing.resultType = (Core.TypeLiteral Core.LiteralTypeString)}},+      Packaging.primitiveDefinitionIsPure = True,+      Packaging.primitiveDefinitionIsTotal = True,+      Packaging.primitiveDefinitionDefaultImplementation = Nothing}++printUint16 :: Packaging.PrimitiveDefinition+printUint16 =+    Packaging.PrimitiveDefinition {+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.printUint16"),+      Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {         Packaging.entityMetadataDescription = (Just "Render a uint16 as a string."),         Packaging.entityMetadataComments = [-          "showUint16(x) returns the canonical decimal representation of x.",-          "Total. The inverse of readUint16."],+          "printUint16(x) returns the canonical decimal representation of x.",+          "Total. The inverse of parseUint16."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {@@ -1289,15 +1290,15 @@       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -showUint32 :: Packaging.PrimitiveDefinition-showUint32 =+printUint32 :: Packaging.PrimitiveDefinition+printUint32 =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.showUint32"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.printUint32"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {         Packaging.entityMetadataDescription = (Just "Render a uint32 as a string."),         Packaging.entityMetadataComments = [-          "showUint32(x) returns the canonical decimal representation of x.",-          "Total. The inverse of readUint32."],+          "printUint32(x) returns the canonical decimal representation of x.",+          "Total. The inverse of parseUint32."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {@@ -1315,15 +1316,15 @@       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -showUint64 :: Packaging.PrimitiveDefinition-showUint64 =+printUint64 :: Packaging.PrimitiveDefinition+printUint64 =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.showUint64"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.printUint64"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {         Packaging.entityMetadataDescription = (Just "Render a uint64 as a string."),         Packaging.entityMetadataComments = [-          "showUint64(x) returns the canonical decimal representation of x.",-          "Total. The inverse of readUint64."],+          "printUint64(x) returns the canonical decimal representation of x.",+          "Total. The inverse of parseUint64."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {@@ -1341,15 +1342,15 @@       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} -showUint8 :: Packaging.PrimitiveDefinition-showUint8 =+printUint8 :: Packaging.PrimitiveDefinition+printUint8 =     Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.showUint8"),+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.printUint8"),       Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {         Packaging.entityMetadataDescription = (Just "Render a uint8 as a string."),         Packaging.entityMetadataComments = [-          "showUint8(x) returns the canonical decimal representation of x.",-          "Total. The inverse of readUint8."],+          "printUint8(x) returns the canonical decimal representation of x.",+          "Total. The inverse of parseUint8."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {
src/main/haskell/Hydra/Lib/Logic.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  and :: Packaging.PrimitiveDefinition and =
src/main/haskell/Hydra/Lib/Maps.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  alter :: Packaging.PrimitiveDefinition alter =@@ -700,6 +701,42 @@       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} +isEmpty :: Packaging.PrimitiveDefinition+isEmpty =+    Packaging.PrimitiveDefinition {+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.maps.isEmpty"),+      Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+        Packaging.entityMetadataDescription = (Just "Test whether a map is empty."),+        Packaging.entityMetadataComments = [+          "isEmpty(m) returns true iff m has no bindings.",+          "Requires an 'ordering' constraint on the key type.",+          "Total. Corresponds to Haskell's Data.Map.null :: Map k v -> Bool."],+        Packaging.entityMetadataSeeAlso = [],+        Packaging.entityMetadataLifecycle = Nothing})),+      Packaging.primitiveDefinitionSignature = Typing.TermSignature {+        Typing.termSignatureTypeParameters = [+          Typing.TypeParameter {+            Typing.typeParameterName = (Core.Name "k"),+            Typing.typeParameterConstraints = [+              Core.TypeClassConstraintSimple (Core.Name "ordering")]},+          Typing.TypeParameter {+            Typing.typeParameterName = (Core.Name "v"),+            Typing.typeParameterConstraints = []}],+        Typing.termSignatureParameters = [+          Typing.Parameter {+            Typing.parameterName = (Core.Name "m"),+            Typing.parameterDescription = (Just "the map to test"),+            Typing.parameterType = (Core.TypeMap (Core.MapType {+              Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")),+              Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))})),+            Typing.parameterIsLazy = False}],+        Typing.termSignatureResult = Typing.Result {+          Typing.resultDescription = Nothing,+          Typing.resultType = (Core.TypeLiteral Core.LiteralTypeBoolean)}},+      Packaging.primitiveDefinitionIsPure = True,+      Packaging.primitiveDefinitionIsTotal = True,+      Packaging.primitiveDefinitionDefaultImplementation = Nothing}+ keys :: Packaging.PrimitiveDefinition keys =     Packaging.PrimitiveDefinition {@@ -951,42 +988,6 @@             Typing.parameterDescription = (Just "the key to test for"),             Typing.parameterType = (Core.TypeVariable (Core.Name "k")),             Typing.parameterIsLazy = False},-          Typing.Parameter {-            Typing.parameterName = (Core.Name "m"),-            Typing.parameterDescription = (Just "the map to test"),-            Typing.parameterType = (Core.TypeMap (Core.MapType {-              Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")),-              Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))})),-            Typing.parameterIsLazy = False}],-        Typing.termSignatureResult = Typing.Result {-          Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeLiteral Core.LiteralTypeBoolean)}},-      Packaging.primitiveDefinitionIsPure = True,-      Packaging.primitiveDefinitionIsTotal = True,-      Packaging.primitiveDefinitionDefaultImplementation = Nothing}--null :: Packaging.PrimitiveDefinition-null =-    Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.maps.null"),-      Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Test whether a map is empty."),-        Packaging.entityMetadataComments = [-          "null(m) returns true iff m has no bindings.",-          "Requires an 'ordering' constraint on the key type.",-          "Total. Corresponds to Haskell's Data.Map.null :: Map k v -> Bool."],-        Packaging.entityMetadataSeeAlso = [],-        Packaging.entityMetadataLifecycle = Nothing})),-      Packaging.primitiveDefinitionSignature = Typing.TermSignature {-        Typing.termSignatureTypeParameters = [-          Typing.TypeParameter {-            Typing.typeParameterName = (Core.Name "k"),-            Typing.typeParameterConstraints = [-              Core.TypeClassConstraintSimple (Core.Name "ordering")]},-          Typing.TypeParameter {-            Typing.typeParameterName = (Core.Name "v"),-            Typing.typeParameterConstraints = []}],-        Typing.termSignatureParameters = [           Typing.Parameter {             Typing.parameterName = (Core.Name "m"),             Typing.parameterDescription = (Just "the map to test"),
src/main/haskell/Hydra/Lib/Math.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  abs :: Packaging.PrimitiveDefinition abs =@@ -166,9 +167,12 @@         Packaging.entityMetadataComments = [           "IEEE 754 binary64 addition. The result is the value of x + y rounded to the nearest representable float64 under the roundTiesToEven rounding-direction attribute.",           "Adding infinities of opposite sign (+\8734 + -\8734 or -\8734 + +\8734) produces a NaN; adding any value to NaN produces a NaN. The sum of two zeros is +0, except (-0) + (-0) = -0.",-          "The operation is total: it never raises, but it may produce NaN. Corresponds to the IEEE 754 \2677.4.1 addition operation and to Haskell's (+) :: Double -> Double -> Double."],+          "The operation is total: it never raises, but it may produce NaN. Corresponds to the IEEE 754 \2677.4.1 addition operation and to Haskell's (+) :: Double -> Double -> Double.",+          "Deprecated since 0.18. Use: hydra.lib.math.add."],         Packaging.entityMetadataSeeAlso = [],-        Packaging.entityMetadataLifecycle = Nothing})),+        Packaging.entityMetadataLifecycle = (Just (Packaging.LifecycleInfo {+          Packaging.lifecycleInfoAvailableSince = Nothing,+          Packaging.lifecycleInfoDeprecatedSince = (Just (Packaging.Version "0.18"))}))})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {         Typing.termSignatureTypeParameters = [],         Typing.termSignatureParameters = [@@ -726,9 +730,12 @@         Packaging.entityMetadataComments = [           "IEEE 754 binary64 multiplication. The result is the value of x * y rounded to the nearest representable float64 under the roundTiesToEven rounding-direction attribute.",           "Multiplying 0 by \177\8734 (in either order) produces a NaN (with invalid-operation exception in IEEE 754); multiplying any value by NaN produces a NaN. The result's sign is the XOR of the operand signs (\2832 * \2832 = \2832 accordingly).",-          "The operation is total: it never raises, but it may produce NaN or \177\8734. Corresponds to the IEEE 754 \2677.4.1 multiplication operation and to Haskell's (*) :: Double -> Double -> Double."],+          "The operation is total: it never raises, but it may produce NaN or \177\8734. Corresponds to the IEEE 754 \2677.4.1 multiplication operation and to Haskell's (*) :: Double -> Double -> Double.",+          "Deprecated since 0.18. Use: hydra.lib.math.mul."],         Packaging.entityMetadataSeeAlso = [],-        Packaging.entityMetadataLifecycle = Nothing})),+        Packaging.entityMetadataLifecycle = (Just (Packaging.LifecycleInfo {+          Packaging.lifecycleInfoAvailableSince = Nothing,+          Packaging.lifecycleInfoDeprecatedSince = (Just (Packaging.Version "0.18"))}))})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {         Typing.termSignatureTypeParameters = [],         Typing.termSignatureParameters = [@@ -788,9 +795,12 @@         Packaging.entityMetadataDescription = (Just "Negate a floating-point number."),         Packaging.entityMetadataComments = [           "Sign reversal of a float64. Equivalent to IEEE 754 \2677.5.1 negate: flips the sign bit, so negate(\2832) = \2832 (sign flips), negate(\177\8734) = \177\8734 (sign flips), and negate(NaN) is a NaN (sign may flip; payload preserved).",-          "This is a bit-level operation that does not raise any floating-point exception. Corresponds to Haskell's negate :: Double -> Double."],+          "This is a bit-level operation that does not raise any floating-point exception. Corresponds to Haskell's negate :: Double -> Double.",+          "Deprecated since 0.18. Use: hydra.lib.math.negate."],         Packaging.entityMetadataSeeAlso = [],-        Packaging.entityMetadataLifecycle = Nothing})),+        Packaging.entityMetadataLifecycle = (Just (Packaging.LifecycleInfo {+          Packaging.lifecycleInfoAvailableSince = Nothing,+          Packaging.lifecycleInfoDeprecatedSince = (Just (Packaging.Version "0.18"))}))})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {         Typing.termSignatureTypeParameters = [],         Typing.termSignatureParameters = [@@ -1213,9 +1223,12 @@         Packaging.entityMetadataComments = [           "IEEE 754 binary64 subtraction, defined as x + (-y). The result is correctly rounded to the nearest representable float64 under roundTiesToEven.",           "Subtracting infinities of the same sign (+\8734 - +\8734 or -\8734 - -\8734) produces a NaN; subtracting any value involving NaN produces a NaN. The difference of two equal finite values is +0 (or -0 under round-toward-negative, which is not the default).",-          "The operation is total: it never raises, but it may produce NaN. Corresponds to the IEEE 754 \2677.4.1 subtraction operation and to Haskell's (-) :: Double -> Double -> Double."],+          "The operation is total: it never raises, but it may produce NaN. Corresponds to the IEEE 754 \2677.4.1 subtraction operation and to Haskell's (-) :: Double -> Double -> Double.",+          "Deprecated since 0.18. Use: hydra.lib.math.sub."],         Packaging.entityMetadataSeeAlso = [],-        Packaging.entityMetadataLifecycle = Nothing})),+        Packaging.entityMetadataLifecycle = (Just (Packaging.LifecycleInfo {+          Packaging.lifecycleInfoAvailableSince = Nothing,+          Packaging.lifecycleInfoDeprecatedSince = (Just (Packaging.Version "0.18"))}))})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {         Typing.termSignatureTypeParameters = [],         Typing.termSignatureParameters = [
src/main/haskell/Hydra/Lib/Optionals.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  apply :: Packaging.PrimitiveDefinition apply =@@ -223,7 +224,7 @@         Packaging.entityMetadataDescription = (Just "Left-fold over a list with an optional-returning function, short-circuiting on none."),         Packaging.entityMetadataComments = [           "foldList(f, acc, xs) folds f over xs from the left, iterating while each application yields given, and returns none as soon as any step yields none. If every element is processed, the result is given of the final accumulator.",-          "foldList(f, acc, xs) is lists.foldl(\\m y -> bind(m, \\x -> f(x, y)), pure(acc), xs); this defining equation is the specification, and the default implementation.",+          "foldList(f, acc, xs) is lists.foldl(\\m y -> bind(m, \\x -> f(x, y)), given(acc), xs); this defining equation is the specification, and the default implementation.",           "Total. Corresponds to a short-circuiting foldM specialised to Maybe."],         Packaging.entityMetadataSeeAlso = [],         Packaging.entityMetadataLifecycle = Nothing})),@@ -292,10 +293,40 @@                               Core.applicationArgument = (Core.TermVariable (Core.Name "x"))})),                             Core.applicationArgument = (Core.TermVariable (Core.Name "y"))}))}))}))}))}))})),                 Core.applicationArgument = (Core.TermApplication (Core.Application {-                  Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.pure")),+                  Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.given")),                   Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))}))})),               Core.applicationArgument = (Core.TermVariable (Core.Name "xs"))}))}))}))})))} +given :: Packaging.PrimitiveDefinition+given =+    Packaging.PrimitiveDefinition {+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.optionals.given"),+      Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+        Packaging.entityMetadataDescription = (Just "Wrap a value in given."),+        Packaging.entityMetadataComments = [+          "given(x) is the optional value containing x.",+          "The constructor for the present case of an optional value.",+          "Total. Corresponds to Haskell's Just :: a -> Maybe a."],+        Packaging.entityMetadataSeeAlso = [],+        Packaging.entityMetadataLifecycle = Nothing})),+      Packaging.primitiveDefinitionSignature = Typing.TermSignature {+        Typing.termSignatureTypeParameters = [+          Typing.TypeParameter {+            Typing.typeParameterName = (Core.Name "x"),+            Typing.typeParameterConstraints = []}],+        Typing.termSignatureParameters = [+          Typing.Parameter {+            Typing.parameterName = (Core.Name "x"),+            Typing.parameterDescription = (Just "the value to wrap in given"),+            Typing.parameterType = (Core.TypeVariable (Core.Name "x")),+            Typing.parameterIsLazy = False}],+        Typing.termSignatureResult = Typing.Result {+          Typing.resultDescription = Nothing,+          Typing.resultType = (Core.TypeOptional (Core.TypeVariable (Core.Name "x")))}},+      Packaging.primitiveDefinitionIsPure = True,+      Packaging.primitiveDefinitionIsTotal = True,+      Packaging.primitiveDefinitionDefaultImplementation = Nothing}+ givens :: Packaging.PrimitiveDefinition givens =     Packaging.PrimitiveDefinition {@@ -567,7 +598,7 @@                                 Core.applicationArgument = (Core.TermVariable (Core.Name "ys"))}))}))})),                           Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))}))}))}))}))}))})),               Core.applicationArgument = (Core.TermApplication (Core.Application {-                Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.pure")),+                Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.given")),                 Core.applicationArgument = (Core.TermList [])}))})),             Core.applicationArgument = (Core.TermVariable (Core.Name "xs"))}))}))})))} @@ -579,9 +610,12 @@         Packaging.entityMetadataDescription = (Just "Map a partial function over a list, keeping only the present results."),         Packaging.entityMetadataComments = [           "mapOptional(f, xs) applies f to each element of xs and returns the list of contained values from given results in original order; none results are discarded.",-          "Total. Corresponds to Haskell's Data.Maybe.mapMaybe :: (a -> Maybe b) -> [a] -> [b]."],+          "Total. Corresponds to Haskell's Data.Maybe.mapMaybe :: (a -> Maybe b) -> [a] -> [b].",+          "Deprecated since 0.18. Use: hydra.lib.lists.mapGivens."],         Packaging.entityMetadataSeeAlso = [],-        Packaging.entityMetadataLifecycle = Nothing})),+        Packaging.entityMetadataLifecycle = (Just (Packaging.LifecycleInfo {+          Packaging.lifecycleInfoAvailableSince = Nothing,+          Packaging.lifecycleInfoDeprecatedSince = (Just (Packaging.Version "0.18"))}))})),       Packaging.primitiveDefinitionSignature = Typing.TermSignature {         Typing.termSignatureTypeParameters = [           Typing.TypeParameter {@@ -709,7 +743,7 @@                                   Core.applicationArgument = (Core.TermVariable (Core.Name "ys"))}))}))})),                             Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))}))}))}))}))}))})),                 Core.applicationArgument = (Core.TermApplication (Core.Application {-                  Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.pure")),+                  Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.given")),                   Core.applicationArgument = (Core.TermList [])}))})),               Core.applicationArgument = (Core.TermApplication (Core.Application {                 Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.toList")),@@ -759,38 +793,6 @@       Packaging.primitiveDefinitionIsPure = True,       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing}--pure :: Packaging.PrimitiveDefinition-pure =-    Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.optionals.pure"),-      Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Wrap a value in given."),-        Packaging.entityMetadataComments = [-          "pure(x) = given(x). The applicative pure for optionals.",-          "Total. Corresponds to Haskell's pure :: a -> Maybe a / Just."],-        Packaging.entityMetadataSeeAlso = [],-        Packaging.entityMetadataLifecycle = Nothing})),-      Packaging.primitiveDefinitionSignature = Typing.TermSignature {-        Typing.termSignatureTypeParameters = [-          Typing.TypeParameter {-            Typing.typeParameterName = (Core.Name "x"),-            Typing.typeParameterConstraints = []}],-        Typing.termSignatureParameters = [-          Typing.Parameter {-            Typing.parameterName = (Core.Name "x"),-            Typing.parameterDescription = (Just "the value to wrap in given"),-            Typing.parameterType = (Core.TypeVariable (Core.Name "x")),-            Typing.parameterIsLazy = False}],-        Typing.termSignatureResult = Typing.Result {-          Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeOptional (Core.TypeVariable (Core.Name "x")))}},-      Packaging.primitiveDefinitionIsPure = True,-      Packaging.primitiveDefinitionIsTotal = True,-      Packaging.primitiveDefinitionDefaultImplementation = (Just (Core.TermLambda (Core.Lambda {-        Core.lambdaParameter = (Core.Name "x"),-        Core.lambdaDomain = Nothing,-        Core.lambdaBody = (Core.TermOptional (Just (Core.TermVariable (Core.Name "x"))))})))}  toList :: Packaging.PrimitiveDefinition toList =
src/main/haskell/Hydra/Lib/Ordering.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  compare :: Packaging.PrimitiveDefinition compare =
src/main/haskell/Hydra/Lib/Pairs.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  bimap :: Packaging.PrimitiveDefinition bimap =@@ -141,6 +142,46 @@         Typing.termSignatureResult = Typing.Result {           Typing.resultDescription = Nothing,           Typing.resultType = (Core.TypeVariable (Core.Name "a"))}},+      Packaging.primitiveDefinitionIsPure = True,+      Packaging.primitiveDefinitionIsTotal = True,+      Packaging.primitiveDefinitionDefaultImplementation = Nothing}++pair :: Packaging.PrimitiveDefinition+pair =+    Packaging.PrimitiveDefinition {+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.pairs.pair"),+      Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+        Packaging.entityMetadataDescription = (Just "Construct a pair from two values."),+        Packaging.entityMetadataComments = [+          "pair(x, y) returns the pair (x, y).",+          "The type-free pair constructor, useful point-free (e.g. zipWith(pair, xs, ys)).",+          "Total. Corresponds to Haskell's (,) :: a -> b -> (a, b)."],+        Packaging.entityMetadataSeeAlso = [],+        Packaging.entityMetadataLifecycle = Nothing})),+      Packaging.primitiveDefinitionSignature = Typing.TermSignature {+        Typing.termSignatureTypeParameters = [+          Typing.TypeParameter {+            Typing.typeParameterName = (Core.Name "a"),+            Typing.typeParameterConstraints = []},+          Typing.TypeParameter {+            Typing.typeParameterName = (Core.Name "b"),+            Typing.typeParameterConstraints = []}],+        Typing.termSignatureParameters = [+          Typing.Parameter {+            Typing.parameterName = (Core.Name "x"),+            Typing.parameterDescription = (Just "the first element"),+            Typing.parameterType = (Core.TypeVariable (Core.Name "a")),+            Typing.parameterIsLazy = False},+          Typing.Parameter {+            Typing.parameterName = (Core.Name "y"),+            Typing.parameterDescription = (Just "the second element"),+            Typing.parameterType = (Core.TypeVariable (Core.Name "b")),+            Typing.parameterIsLazy = False}],+        Typing.termSignatureResult = Typing.Result {+          Typing.resultDescription = Nothing,+          Typing.resultType = (Core.TypePair (Core.PairType {+            Core.pairTypeFirst = (Core.TypeVariable (Core.Name "a")),+            Core.pairTypeSecond = (Core.TypeVariable (Core.Name "b"))}))}},       Packaging.primitiveDefinitionIsPure = True,       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing}
src/main/haskell/Hydra/Lib/Regex.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  find :: Packaging.PrimitiveDefinition find =
src/main/haskell/Hydra/Lib/Sets.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  delete :: Packaging.PrimitiveDefinition delete =@@ -357,6 +358,37 @@               Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.toList")),               Core.applicationArgument = (Core.TermVariable (Core.Name "s1"))}))}))}))})))} +isEmpty :: Packaging.PrimitiveDefinition+isEmpty =+    Packaging.PrimitiveDefinition {+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.sets.isEmpty"),+      Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+        Packaging.entityMetadataDescription = (Just "Test whether a set is empty."),+        Packaging.entityMetadataComments = [+          "isEmpty(s) returns true iff s has no elements.",+          "Requires an 'ordering' constraint on the element type.",+          "Total. Corresponds to Haskell's Data.Set.null :: Set a -> Bool."],+        Packaging.entityMetadataSeeAlso = [],+        Packaging.entityMetadataLifecycle = Nothing})),+      Packaging.primitiveDefinitionSignature = Typing.TermSignature {+        Typing.termSignatureTypeParameters = [+          Typing.TypeParameter {+            Typing.typeParameterName = (Core.Name "x"),+            Typing.typeParameterConstraints = [+              Core.TypeClassConstraintSimple (Core.Name "ordering")]}],+        Typing.termSignatureParameters = [+          Typing.Parameter {+            Typing.parameterName = (Core.Name "s"),+            Typing.parameterDescription = (Just "the set to test for emptiness"),+            Typing.parameterType = (Core.TypeSet (Core.TypeVariable (Core.Name "x"))),+            Typing.parameterIsLazy = False}],+        Typing.termSignatureResult = Typing.Result {+          Typing.resultDescription = Nothing,+          Typing.resultType = (Core.TypeLiteral Core.LiteralTypeBoolean)}},+      Packaging.primitiveDefinitionIsPure = True,+      Packaging.primitiveDefinitionIsTotal = True,+      Packaging.primitiveDefinitionDefaultImplementation = Nothing}+ map :: Packaging.PrimitiveDefinition map =     Packaging.PrimitiveDefinition {@@ -440,37 +472,6 @@           Typing.Parameter {             Typing.parameterName = (Core.Name "s"),             Typing.parameterDescription = (Just "the set to test against"),-            Typing.parameterType = (Core.TypeSet (Core.TypeVariable (Core.Name "x"))),-            Typing.parameterIsLazy = False}],-        Typing.termSignatureResult = Typing.Result {-          Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeLiteral Core.LiteralTypeBoolean)}},-      Packaging.primitiveDefinitionIsPure = True,-      Packaging.primitiveDefinitionIsTotal = True,-      Packaging.primitiveDefinitionDefaultImplementation = Nothing}--null :: Packaging.PrimitiveDefinition-null =-    Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.sets.null"),-      Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Test whether a set is empty."),-        Packaging.entityMetadataComments = [-          "null(s) returns true iff s has no elements.",-          "Requires an 'ordering' constraint on the element type.",-          "Total. Corresponds to Haskell's Data.Set.null :: Set a -> Bool."],-        Packaging.entityMetadataSeeAlso = [],-        Packaging.entityMetadataLifecycle = Nothing})),-      Packaging.primitiveDefinitionSignature = Typing.TermSignature {-        Typing.termSignatureTypeParameters = [-          Typing.TypeParameter {-            Typing.typeParameterName = (Core.Name "x"),-            Typing.typeParameterConstraints = [-              Core.TypeClassConstraintSimple (Core.Name "ordering")]}],-        Typing.termSignatureParameters = [-          Typing.Parameter {-            Typing.parameterName = (Core.Name "s"),-            Typing.parameterDescription = (Just "the set to test for emptiness"),             Typing.parameterType = (Core.TypeSet (Core.TypeVariable (Core.Name "x"))),             Typing.parameterIsLazy = False}],         Typing.termSignatureResult = Typing.Result {
src/main/haskell/Hydra/Lib/Strings.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  charAt :: Packaging.PrimitiveDefinition charAt =@@ -151,6 +152,32 @@       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing} +isEmpty :: Packaging.PrimitiveDefinition+isEmpty =+    Packaging.PrimitiveDefinition {+      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.strings.isEmpty"),+      Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+        Packaging.entityMetadataDescription = (Just "Check whether a string is empty."),+        Packaging.entityMetadataComments = [+          "isEmpty(s) returns true iff s is the empty string.",+          "Total. Corresponds to Haskell's null :: String -> Bool."],+        Packaging.entityMetadataSeeAlso = [],+        Packaging.entityMetadataLifecycle = Nothing})),+      Packaging.primitiveDefinitionSignature = Typing.TermSignature {+        Typing.termSignatureTypeParameters = [],+        Typing.termSignatureParameters = [+          Typing.Parameter {+            Typing.parameterName = (Core.Name "s"),+            Typing.parameterDescription = (Just "the string to test for emptiness"),+            Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString),+            Typing.parameterIsLazy = False}],+        Typing.termSignatureResult = Typing.Result {+          Typing.resultDescription = Nothing,+          Typing.resultType = (Core.TypeLiteral Core.LiteralTypeBoolean)}},+      Packaging.primitiveDefinitionIsPure = True,+      Packaging.primitiveDefinitionIsTotal = True,+      Packaging.primitiveDefinitionDefaultImplementation = Nothing}+ join :: Packaging.PrimitiveDefinition join =     Packaging.PrimitiveDefinition {@@ -205,32 +232,6 @@         Typing.termSignatureResult = Typing.Result {           Typing.resultDescription = Nothing,           Typing.resultType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32))}},-      Packaging.primitiveDefinitionIsPure = True,-      Packaging.primitiveDefinitionIsTotal = True,-      Packaging.primitiveDefinitionDefaultImplementation = Nothing}--null :: Packaging.PrimitiveDefinition-null =-    Packaging.PrimitiveDefinition {-      Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.strings.null"),-      Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {-        Packaging.entityMetadataDescription = (Just "Check whether a string is empty."),-        Packaging.entityMetadataComments = [-          "null(s) returns true iff s is the empty string.",-          "Total. Corresponds to Haskell's null :: String -> Bool."],-        Packaging.entityMetadataSeeAlso = [],-        Packaging.entityMetadataLifecycle = Nothing})),-      Packaging.primitiveDefinitionSignature = Typing.TermSignature {-        Typing.termSignatureTypeParameters = [],-        Typing.termSignatureParameters = [-          Typing.Parameter {-            Typing.parameterName = (Core.Name "s"),-            Typing.parameterDescription = (Just "the string to test for emptiness"),-            Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString),-            Typing.parameterIsLazy = False}],-        Typing.termSignatureResult = Typing.Result {-          Typing.resultDescription = Nothing,-          Typing.resultType = (Core.TypeLiteral Core.LiteralTypeBoolean)}},       Packaging.primitiveDefinitionIsPure = True,       Packaging.primitiveDefinitionIsTotal = True,       Packaging.primitiveDefinitionDefaultImplementation = Nothing}
src/main/haskell/Hydra/Lib/System.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  execute :: Packaging.PrimitiveDefinition execute =
src/main/haskell/Hydra/Lib/Text.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  decodeUtf8 :: Packaging.PrimitiveDefinition decodeUtf8 =
src/main/haskell/Hydra/Literals.hs view
@@ -36,6 +36,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Convert a bigint to an integer value of a given type (note: lossy) bigintToIntegerValue :: Core.IntegerType -> Integer -> Core.IntegerValue
src/main/haskell/Hydra/Names.hs view
@@ -48,6 +48,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S @@ -57,7 +58,7 @@        let tryLabel =               \index ->-                let candidate = Logic.ifElse (Equality.equal index 1) label (Strings.concat2 label (Literals.showInt32 index))+                let candidate = Logic.ifElse (Equality.equal index 1) label (Strings.concat2 label (Literals.printInt32 index))                 in (Logic.ifElse (Sets.member candidate reserved) (tryLabel (Math.add index 1)) candidate)       in (tryLabel 1) @@ -122,7 +123,7 @@                     result = freshName cx0                     name = Pairs.first result                     cx1 = Pairs.second result-                in (Lists.concat2 names (Lists.pure name), cx1)+                in (Lists.concat2 names (Lists.singleton name), cx1)       in (Lists.foldl go ([], cx) (Lists.replicate n ()))  -- | Extract the local part of a name@@ -159,7 +160,7 @@  -- | Type variable naming convention follows Haskell: t0, t1, etc. normalTypeVariable :: Int -> Core.Name-normalTypeVariable i = Core.Name (Strings.concat2 "t" (Literals.showInt32 i))+normalTypeVariable i = Core.Name (Strings.concat2 "t" (Literals.printInt32 i))  -- | Prepend a SubtermStep to the InferenceContext's trace. The trace is accumulated backwards as inference descends through subterms; at error-emission time the list is reversed and wrapped into a SubtermPath stamped onto the error. pushSubtermStep :: Paths.SubtermStep -> Typing.InferenceContext -> Typing.InferenceContext@@ -186,7 +187,7 @@         Util.qualifiedNameLocal = (Core.unName name)}) (\uc ->         let localName = Pairs.first uc             restReversed = Pairs.second uc-        in (Logic.ifElse (Lists.null restReversed) (Util.QualifiedName {+        in (Logic.ifElse (Lists.isEmpty restReversed) (Util.QualifiedName {           Util.qualifiedNameModuleName = Nothing,           Util.qualifiedNameLocal = (Core.unName name)}) (Util.QualifiedName {           Util.qualifiedNameModuleName = (Just (Packaging.ModuleName (Strings.join "." (Lists.reverse restReversed)))),
src/main/haskell/Hydra/Overlay/Haskell/Bootstrap.hs view
@@ -47,7 +47,7 @@     typeDefinitionBody = TypeScheme {       typeSchemeVariables = [],       typeSchemeBody = typ,-      typeSchemeConstraints = Nothing}}+      typeSchemeConstraints = M.empty}}  -- | Define a type in a namespace defineType :: ModuleName -> String -> Type -> TypeDefinition
src/main/haskell/Hydra/Overlay/Haskell/Dsl/Typed/Phantoms.hs view
@@ -374,13 +374,13 @@  -- | Reify a Haskell-level meta-function over phantom-typed terms into a first-class -- term-level function. See also 'reify2' for the binary form.--- Example: @reify Literals.showInt32@ has type @TypedTerm (Int -> String)@+-- Example: @reify Literals.printInt32@ has type @TypedTerm (Int -> String)@ reify :: (TypedTerm a -> TypedTerm b) -> TypedTerm (a -> b) reify f = case (unTypedTerm $ f $ var "x") of   TermApplication (Application lhs _) -> TypedTerm lhs   TermEither (Prelude.Left _) -> lambda "x" $ TypedTerm $ TermEither $ Prelude.Left $ Terms.var "x"   TermEither (Prelude.Right _) -> lambda "x" $ TypedTerm $ TermEither $ Prelude.Right $ Terms.var "x"-  TermOptional (Just _) -> primitive (Prims.primName DefOptionals.pure)+  TermOptional (Just _) -> primitive (Prims.primName DefOptionals.given)   TermInject (Injection tname (Field fname _)) -> lambda "x" $ inject tname fname $ var "x"   TermWrap (WrappedTerm tname _) -> lambda "x" $ wrap tname $ var "x" @@ -435,6 +435,24 @@ primitiveWithDefaultInModule mod localName description sig comments (TypedTerm impl) =   (primitiveInModule mod localName description sig comments) { primitiveDefinitionDefaultImplementation = Just impl } +-- | Stamp a primitive as deprecated since the given version, pointing at its replacement.+-- Sets @LifecycleInfo.deprecatedSince@ in the primitive's entity metadata and records the+-- replacement as a @Use:@ comment, so the deprecation is both machine-checkable (the stamp)+-- and legible in the generated documentation (the comment). See the compatibility specification+-- (docs/specification/compatibility.md §3) for the deprecation policy.+-- Example: member = deprecatedSince "0.18" "hydra.lib.lists.member" $ define "elem" ...+deprecatedSince :: String -> String -> PrimitiveDefinition -> PrimitiveDefinition+deprecatedSince ver useReplacement pd =+    pd {primitiveDefinitionMetadata = Just meta'}+  where+    lifecycle = LifecycleInfo Nothing (Just (Version ver))+    useComment = L.concat ["Deprecated since ", ver, ". Use: ", useReplacement, "."]+    meta' = case primitiveDefinitionMetadata pd of+      Just m -> m {+        entityMetadataComments = L.concat [entityMetadataComments m, [useComment]],+        entityMetadataLifecycle = Just lifecycle}+      Nothing -> EntityMetadata Nothing [useComment] [] (Just lifecycle)+ -- | Define an impure primitive (no default implementation) within a module. -- Example: defineImpure = impurePrimitiveInModule module_ impurePrimitiveInModule :: Module -> String -> String -> TermSignature -> [String] -> PrimitiveDefinition@@ -442,13 +460,13 @@   (primitiveInModule mod localName description sig comments) { primitiveDefinitionIsPure = False }  -- | Convert a TypeScheme to a TermSignature. Exported for use in primitive modules.--- Example: sig $ TypeScheme [] (Types.boolean Types.~> Types.boolean) Nothing+-- Example: sig $ TypeScheme [] (Types.boolean Types.~> Types.boolean) mempty sig :: TypeScheme -> TermSignature sig = typeSchemeToTermSignature  -- | Convert a TypeScheme to a TermSignature with lazy parameters at the given (0-based) positions. -- Coders that distinguish strict from lazy evaluation thunk exactly these arguments.--- Example: lazySig [1, 2] $ TypeScheme [Name "x"] (Types.boolean Types.~> ...) Nothing+-- Example: lazySig [1, 2] $ TypeScheme [Name "x"] (Types.boolean Types.~> ...) mempty lazySig :: [Int] -> TypeScheme -> TermSignature lazySig idxs ts = markLazyParams idxs (sig ts) @@ -464,7 +482,7 @@ -- Arity-checked: fails immediately if the number of pairs does not match the number of value -- parameters peeled from the type (this catches signature/name drift at DSL-load time). -- Example: sigWithParams [("x", "the value to compare"), ("y", "the value to compare against")] $---            TypeScheme [Name "x"] (tx ~> tx ~> boolean) Nothing+--            TypeScheme [Name "x"] (tx ~> tx ~> boolean) mempty sigWithParams :: [(String, String)] -> TypeScheme -> TermSignature sigWithParams pairs ts =     let s = sig ts
src/main/haskell/Hydra/Overlay/Haskell/Dsl/Typed/Testing.hs view
@@ -334,7 +334,7 @@  encodedTestGroupToBinding :: ModuleName -> String -> TypedTerm TestGroup -> Binding encodedTestGroupToBinding ns lname group = Binding name (unTypedTerm group)-    $ Just $ TypeScheme [] typ Nothing+    $ Just $ TypeScheme [] typ M.empty   where     name = unqualifyName $ QualifiedName (Just ns) lname     typ = TypeVariable _TestGroup
src/main/haskell/Hydra/Overlay/Haskell/Dsl/Typed/Types.hs view
@@ -180,7 +180,7 @@ mono t = Phantoms.record _TypeScheme [   Phantoms.field _TypeScheme_variables $ Phantoms.list ([] :: [TypedTerm Name]),   Phantoms.field _TypeScheme_body t,-  Phantoms.field _TypeScheme_constraints Phantoms.nothing]+  Phantoms.field _TypeScheme_constraints (Phantoms.map M.empty)]  -- | Term-encoded non-negative 32-bit integer type -- Currently an alias for int32; intended for semantic annotation@@ -205,7 +205,7 @@ poly params t = Phantoms.record _TypeScheme [   Phantoms.field _TypeScheme_variables (Phantoms.list (name <$> params)),   Phantoms.field _TypeScheme_body t,-  Phantoms.field _TypeScheme_constraints Phantoms.nothing]+  Phantoms.field _TypeScheme_constraints (Phantoms.map M.empty)]  -- | Create a term-encoded polymorphic type scheme with class constraints -- Example: polyConstrained ["k", "v"] [("k", ["ordering"])] (map (var "k") (var "v"))@@ -215,8 +215,8 @@   Phantoms.field _TypeScheme_body t,   Phantoms.field _TypeScheme_constraints constraintsTerm]   where-    constraintsTerm = Phantoms.just $ Phantoms.map $ M.fromList-      [(name v, Core.typeVariableConstraints (Phantoms.list (Core.typeClassConstraintSimple . name <$> classes)))+    constraintsTerm = Phantoms.map $ M.fromList+      [(name v, Core.typeVariableConstraints (Phantoms.set (Core.typeClassConstraintSimple . name <$> classes)))       | (v, classes) <- constraints]  -- | Create a term-encoded product type (tuple) with multiple components using nested pairs
src/main/haskell/Hydra/Overlay/Haskell/Dsl/Types.hs view
@@ -168,7 +168,7 @@ -- | Create a monomorphic type scheme -- Example: mono int32 mono :: AsType a => a -> TypeScheme-mono t = TypeScheme [] (asType t) Nothing+mono t = TypeScheme [] (asType t) M.empty  -- | Non-negative 32-bit integer type -- Currently an alias for int32; intended for semantic annotation@@ -190,17 +190,17 @@ -- Example: poly ["a", "b"] (var "a" --> var "b") -- This represents a type forall a b. a -> b that can be instantiated with different types poly :: AsType a => [String] -> a -> TypeScheme-poly vs t = TypeScheme (Name <$> vs) (asType t) Nothing+poly vs t = TypeScheme (Name <$> vs) (asType t) M.empty  -- | Create a polymorphic type scheme with explicit type variables and constraints -- Example: polyConstrained [("a", [Name "hydra.core.Eq"])] (var "a" --> var "a" --> boolean) -- This represents a type forall a. (Eq a) => a -> a -> Boolean polyConstrained :: AsType a => [(String, [Name])] -> a -> TypeScheme-polyConstrained vsWithConstraints t = TypeScheme vars (asType t) (Just constraintMap)+polyConstrained vsWithConstraints t = TypeScheme vars (asType t) constraintMap   where     vars = Name . fst <$> vsWithConstraints     constraintMap = M.fromList-      [(Name v, TypeVariableConstraints (TypeClassConstraintSimple <$> classes)) | (v, classes) <- vsWithConstraints, not (L.null classes)]+      [(Name v, TypeVariableConstraints (S.fromList (TypeClassConstraintSimple <$> classes))) | (v, classes) <- vsWithConstraints, not (L.null classes)]  -- | Create a product type using nested pairs (deprecated: use pair directly) -- Example: product [string, int32, boolean] creates pair string (pair int32 boolean)
src/main/haskell/Hydra/Overlay/Haskell/Lib/Eithers.hs view
@@ -2,7 +2,7 @@  module Hydra.Overlay.Haskell.Lib.Eithers where -import Prelude hiding (either, map, pure)+import Prelude hiding (either, map) import qualified Control.Monad as CM import qualified Data.Bifunctor as BF import qualified Data.Either as E@@ -41,6 +41,10 @@ isRight :: Either a b -> Bool isRight = E.isRight +-- | Construct a Left (error/exceptional) Either value.+left :: a -> Either a b+left = Left+ -- | Extract all Left values from a list of Eithers. lefts :: [Either a b] -> [a] lefts = E.lefts@@ -65,9 +69,9 @@ partition :: [Either a b] -> ([a], [b]) partition = E.partitionEithers --- | Wrap a value as a Right.-pure :: b -> Either a b-pure = Right+-- | Construct a Right (success/normal) Either value.+right :: b -> Either a b+right = Right  -- | Extract all Right values from a list of Eithers. rights :: [Either a b] -> [b]
src/main/haskell/Hydra/Overlay/Haskell/Lib/Functions.hs view
@@ -5,6 +5,10 @@ import qualified Prelude as P  +-- | Eliminate a value of the uninhabited void type. Unreachable in any well-typed program.+absurd :: a -> b+absurd _ = P.error "hydra.lib.functions.absurd: void has no inhabitants"+ -- | Compose two functions: compose g f x = g (f x). compose :: (b -> c) -> (a -> b) -> a -> c compose g f = \x -> g (f x)
src/main/haskell/Hydra/Overlay/Haskell/Lib/Lists.hs view
@@ -2,7 +2,7 @@  module Hydra.Overlay.Haskell.Lib.Lists where -import Prelude hiding (compose, head, init, last, map, pure, tail, takeWhile)+import Prelude hiding (compose, head, init, last, map, tail, takeWhile) import Hydra.Util import Hydra.Core import Hydra.Graph@@ -132,16 +132,12 @@ member = L.elem  -- | Check if a list is empty.-null :: [a] -> Bool-null = L.null+isEmpty :: [a] -> Bool+isEmpty = L.null  -- | Partition a list into elements that satisfy a predicate and elements that do not. partition :: (a -> Bool) -> [a] -> ([a], [a]) partition = L.partition---- | Create a list with a single element.-pure :: a -> [a]-pure e = [e]  -- | Create a list with n copies of a value. replicate :: Int -> a -> [a]
src/main/haskell/Hydra/Overlay/Haskell/Lib/Literals.hs view
@@ -112,8 +112,8 @@ int64ToBigint = fromIntegral  -- | Parse a string to a bigint (Integer).-readBigint :: String -> Maybe Integer-readBigint s = readMaybe s :: Maybe Integer+parseBigint :: String -> Maybe Integer+parseBigint s = readMaybe s :: Maybe Integer  -- | Parse a string to a boolean. parseBoolean :: String -> Maybe Bool@@ -122,72 +122,72 @@   else Nothing  -- | Parse a string to a decimal (Scientific).-readDecimal :: String -> Maybe Scientific-readDecimal s = readMaybe s :: Maybe Scientific+parseDecimal :: String -> Maybe Scientific+parseDecimal s = readMaybe s :: Maybe Scientific  -- | Parse a string to a float32 (Float).-readFloat32 :: String -> Maybe Float-readFloat32 s = readMaybe s :: Maybe Float+parseFloat32 :: String -> Maybe Float+parseFloat32 s = readMaybe s :: Maybe Float  -- | Parse a string to a float64 (Double).-readFloat64 :: String -> Maybe Double-readFloat64 s = readMaybe s :: Maybe Double---- | Parse a string to an int8 (-128 to 127).-readInt8 :: String -> Maybe Int8-readInt8 s = do-  n <- readMaybe s :: Maybe Integer-  if n >= -128 && n <= 127 then Just (fromIntegral n) else Nothing+parseFloat64 :: String -> Maybe Double+parseFloat64 s = readMaybe s :: Maybe Double  -- | Parse a string to an int16 (-32768 to 32767).-readInt16 :: String -> Maybe Int16-readInt16 s = do+parseInt16 :: String -> Maybe Int16+parseInt16 s = do   n <- readMaybe s :: Maybe Integer   if n >= -32768 && n <= 32767 then Just (fromIntegral n) else Nothing  -- | Parse a string to an int32.-readInt32 :: String -> Maybe Int-readInt32 s = readMaybe s :: Maybe Int+parseInt32 :: String -> Maybe Int+parseInt32 s = readMaybe s :: Maybe Int  -- | Parse a string to an int64.-readInt64 :: String -> Maybe Int64-readInt64 s = readMaybe s :: Maybe Int64+parseInt64 :: String -> Maybe Int64+parseInt64 s = readMaybe s :: Maybe Int64 +-- | Parse a string to an int8 (-128 to 127).+parseInt8 :: String -> Maybe Int8+parseInt8 s = do+  n <- readMaybe s :: Maybe Integer+  if n >= -128 && n <= 127 then Just (fromIntegral n) else Nothing+ -- | Parse a string literal. parseString :: String -> Maybe String parseString s = readMaybe s :: Maybe String  -- Note: Hydra uses wider signed types to represent unsigned values without overflow -- Uint8 -> Int16, Uint16 -> Int, Uint32 -> Int64, Uint64 -> Integer--- The read functions parse as unsigned and validate the range---- | Parse a string to a uint8 (0 to 255).-readUint8 :: String -> Maybe Int16-readUint8 s = do-  n <- readMaybe s :: Maybe Integer-  if n >= 0 && n <= 255 then Just (fromIntegral n) else Nothing+-- The parse functions parse as unsigned and validate the range  -- | Parse a string to a uint16 (0 to 65535).-readUint16 :: String -> Maybe Int-readUint16 s = do+parseUint16 :: String -> Maybe Int+parseUint16 s = do   n <- readMaybe s :: Maybe Integer   if n >= 0 && n <= 65535 then Just (fromIntegral n) else Nothing  -- | Parse a string to a uint32 (0 to 4294967295).-readUint32 :: String -> Maybe Int64-readUint32 s = do+parseUint32 :: String -> Maybe Int64+parseUint32 s = do   n <- readMaybe s :: Maybe Integer   if n >= 0 && n <= 4294967295 then Just (fromIntegral n) else Nothing  -- | Parse a string to a uint64 (0 to 18446744073709551615).-readUint64 :: String -> Maybe Integer-readUint64 s = do+parseUint64 :: String -> Maybe Integer+parseUint64 s = do   n <- readMaybe s :: Maybe Integer   if n >= 0 && n <= 18446744073709551615 then Just n else Nothing +-- | Parse a string to a uint8 (0 to 255).+parseUint8 :: String -> Maybe Int16+parseUint8 s = do+  n <- readMaybe s :: Maybe Integer+  if n >= 0 && n <= 255 then Just (fromIntegral n) else Nothing+ -- | Convert a bigint (Integer) to string.-showBigint :: Integer -> String-showBigint = show+printBigint :: Integer -> String+printBigint = show  -- | Convert a boolean to string. printBoolean :: Bool -> String@@ -198,52 +198,52 @@ -- | Convert a decimal (Scientific) to string. Uses Scientific's default format --   (regular notation for small-magnitude values; scientific notation for very --   large or very small).-showDecimal :: Scientific -> String-showDecimal = show+printDecimal :: Scientific -> String+printDecimal = show  -- | Convert a float32 (Float) to string.-showFloat32 :: Float -> String-showFloat32 = show+printFloat32 :: Float -> String+printFloat32 = show  -- | Convert a float64 (Double) to string.-showFloat64 :: Double -> String-showFloat64 = show---- | Convert an int8 to string.-showInt8 :: Int8 -> String-showInt8 = show+printFloat64 :: Double -> String+printFloat64 = show  -- | Convert an int16 to string.-showInt16 :: Int16 -> String-showInt16 = show+printInt16 :: Int16 -> String+printInt16 = show  -- | Convert an int32 to string.-showInt32 :: Int -> String-showInt32 = show+printInt32 :: Int -> String+printInt32 = show  -- | Convert an int64 to string.-showInt64 :: Int64 -> String-showInt64 = show+printInt64 :: Int64 -> String+printInt64 = show +-- | Convert an int8 to string.+printInt8 :: Int8 -> String+printInt8 = show+ -- | Convert a string to a quoted string representation. printString :: String -> String printString = show --- | Convert a uint8 to string.-showUint8 :: Int16 -> String-showUint8 = show- -- | Convert a uint16 to string.-showUint16 :: Int -> String-showUint16 = show+printUint16 :: Int -> String+printUint16 = show  -- | Convert a uint32 to string.-showUint32 :: Int64 -> String-showUint32 = show+printUint32 :: Int64 -> String+printUint32 = show  -- | Convert a uint64 to string.-showUint64 :: Integer -> String-showUint64 = show+printUint64 :: Integer -> String+printUint64 = show++-- | Convert a uint8 to string.+printUint8 :: Int16 -> String+printUint8 = show  -- | Convert string to binary by base64 decoding. -- Returns an empty ByteString if decoding fails.
src/main/haskell/Hydra/Overlay/Haskell/Lib/Maps.hs view
@@ -74,8 +74,8 @@ member = M.member  -- | Check if a map is empty.-null :: M.Map k v -> Bool-null = M.null+isEmpty :: M.Map k v -> Bool+isEmpty = M.null  -- | Create a map with a single key-value pair. singleton :: k -> v -> M.Map k v
src/main/haskell/Hydra/Overlay/Haskell/Lib/Optionals.hs view
@@ -2,7 +2,7 @@  module Hydra.Overlay.Haskell.Lib.Optionals where -import Prelude hiding (map, pure)+import Prelude hiding (map) import qualified Control.Monad as CM import qualified Data.Maybe as Y import qualified Data.Set as S@@ -24,6 +24,10 @@ foldList :: (a -> b -> Y.Maybe a) -> a -> [b] -> Y.Maybe a foldList = CM.foldM +-- | Lift a value into the optional type.+given :: a -> Y.Maybe a+given = Just+ -- | Filter out absent values from a list. givens :: [Y.Maybe a] -> [a] givens = Y.catMaybes@@ -55,10 +59,6 @@ -- | Handle an optional value with the absent-case value as the first argument. match :: Y.Maybe a -> b -> (a -> b) -> b match m n j = Y.maybe n j m---- | Lift a value into the optional type.-pure :: a -> Y.Maybe a-pure = Just  -- | Convert an optional value to a list: a present value becomes [x], an absent value becomes []. toList :: Y.Maybe a -> [a]
src/main/haskell/Hydra/Overlay/Haskell/Lib/Pairs.hs view
@@ -13,6 +13,10 @@ first :: (a, b) -> a first (x, _) = x +-- | Construct a pair from two values.+pair :: a -> b -> (a, b)+pair x y = (x, y)+ -- | Get the second element of a pair. second :: (a, b) -> b second (_, y) = y
src/main/haskell/Hydra/Overlay/Haskell/Lib/Sets.hs view
@@ -44,8 +44,8 @@ member = S.member  -- | Check if a set is empty.-null :: S.Set x -> Bool-null = S.null+isEmpty :: S.Set x -> Bool+isEmpty = S.null  -- | Create a singleton set. -- Consider renaming this to Sets.pure, or creating an alias
src/main/haskell/Hydra/Overlay/Haskell/Lib/Strings.hs view
@@ -2,7 +2,7 @@  module Hydra.Overlay.Haskell.Lib.Strings where -import Prelude hiding (concat, length, null)+import Prelude hiding (concat, length) import qualified Data.Char as C import qualified Data.List as L import qualified Data.List.Split as LS@@ -35,8 +35,8 @@ length = L.length  -- | Check whether a string is empty.-null :: String -> Bool-null = L.null+isEmpty :: String -> Bool+isEmpty = L.null  -- | Split a string on a delimiter string. splitOn :: String -> String -> [String]
src/main/haskell/Hydra/Overlay/Haskell/Libraries.hs view
@@ -135,6 +135,7 @@     prim3       DefEithers.foldList            Eithers.foldList            (fun x_ (fun y_ (Prims.either_ z_ x_))) x_ (list y_) (Prims.either_ z_ x_),     prim1       DefEithers.isLeft           Eithers.isLeft           (Prims.either_ x_ y_) boolean,     prim1       DefEithers.isRight          Eithers.isRight          (Prims.either_ x_ y_) boolean,+    prim1       DefEithers.left             Eithers.left             x_ (Prims.either_ x_ y_),     prim1       DefEithers.lefts            Eithers.lefts            (list $ Prims.either_ x_ y_) (list x_),     prim2       DefEithers.map              Eithers.map              (funT x_ y_) (Prims.either_ z_ x_) (Prims.either_ z_ y_),     prim2       DefEithers.mapList          Eithers.mapList          (fun x_ (Prims.either_ z_ y_)) (list x_) (Prims.either_ z_ (list y_)),@@ -142,7 +143,7 @@     prim2       DefEithers.mapSet           Eithers.mapSet           (fun x_ (Prims.either_ z_ y_)) (set x_) (Prims.either_ z_ (set y_)),     prim1       DefEithers.partition        Eithers.partition        (list $ Prims.either_ x_ y_) (pair (list x_) (list y_)),     prim1       DefEithers.partition Eithers.partition (list $ Prims.either_ x_ y_) (pair (list x_) (list y_)),-    prim1       DefEithers.pure             Eithers.pure             y_ (Prims.either_ x_ y_),+    prim1       DefEithers.right            Eithers.right            y_ (Prims.either_ x_ y_),     prim1       DefEithers.rights           Eithers.rights           (list $ Prims.either_ x_ y_) (list y_)]  hydraLibEquality :: Library@@ -162,6 +163,7 @@  hydraLibFunctions :: Library hydraLibFunctions = standardLibrary [+    prim1 DefFunctions.absurd   Functions.absurd   x_ y_,     prim3 DefFunctions.compose  Functions.compose  (funT y_ z_) (funT x_ y_) x_ z_,     prim2 DefFunctions.const    Functions.const    x_ y_ x_,     prim3 DefFunctions.flip     Functions.flip     (funT x_ (funT y_ z_)) y_ x_ z_,@@ -204,9 +206,8 @@     prim1     DefLists.last   Lists.last     (list x_) (optional x_),     prim1     DefLists.tail   Lists.tail     (list x_) (optional (list x_)),     prim1     DefLists.distinct         Lists.distinct           (list x_) (list x_),-    prim1     DefLists.null        Lists.null          (list x_) boolean,+    prim1     DefLists.isEmpty     Lists.isEmpty       (list x_) boolean,     prim2     DefLists.partition   Lists.partition     (fun x_ boolean) (list x_) (pair (list x_) (list x_)),-    prim1     DefLists.pure        Lists.pure          x_ (list x_),     prim2     DefLists.replicate   Lists.replicate     int32 x_ (list x_),     prim1     DefLists.reverse     Lists.reverse       (list x_) (list x_),     prim1     DefLists.singleton   Lists.singleton     x_ (list x_),@@ -246,34 +247,34 @@   prim1 DefLiterals.int16ToBigint     Literals.int16ToBigint     int16 bigint,   prim1 DefLiterals.int32ToBigint     Literals.int32ToBigint     int32 bigint,   prim1 DefLiterals.int64ToBigint     Literals.int64ToBigint     int64 bigint,-  prim1 DefLiterals.readBigint        Literals.readBigint        string (optional bigint),+  prim1 DefLiterals.parseBigint       Literals.parseBigint       string (optional bigint),   prim1 DefLiterals.parseBoolean       Literals.parseBoolean       string (optional boolean),-  prim1 DefLiterals.readDecimal       Literals.readDecimal       string (optional decimal),-  prim1 DefLiterals.readFloat32       Literals.readFloat32       string (optional float32),-  prim1 DefLiterals.readFloat64       Literals.readFloat64       string (optional float64),-  prim1 DefLiterals.readInt8          Literals.readInt8          string (optional int8),-  prim1 DefLiterals.readInt16         Literals.readInt16         string (optional int16),-  prim1 DefLiterals.readInt32         Literals.readInt32         string (optional int32),-  prim1 DefLiterals.readInt64         Literals.readInt64         string (optional int64),+  prim1 DefLiterals.parseDecimal      Literals.parseDecimal      string (optional decimal),+  prim1 DefLiterals.parseFloat32      Literals.parseFloat32      string (optional float32),+  prim1 DefLiterals.parseFloat64      Literals.parseFloat64      string (optional float64),+  prim1 DefLiterals.parseInt8         Literals.parseInt8         string (optional int8),+  prim1 DefLiterals.parseInt16        Literals.parseInt16        string (optional int16),+  prim1 DefLiterals.parseInt32        Literals.parseInt32        string (optional int32),+  prim1 DefLiterals.parseInt64        Literals.parseInt64        string (optional int64),   prim1 DefLiterals.parseString        Literals.parseString        string (optional string),-  prim1 DefLiterals.readUint8         Literals.readUint8         string (optional uint8),-  prim1 DefLiterals.readUint16        Literals.readUint16        string (optional uint16),-  prim1 DefLiterals.readUint32        Literals.readUint32        string (optional uint32),-  prim1 DefLiterals.readUint64        Literals.readUint64        string (optional uint64),-  prim1 DefLiterals.showBigint        Literals.showBigint        bigint string,+  prim1 DefLiterals.parseUint8        Literals.parseUint8        string (optional uint8),+  prim1 DefLiterals.parseUint16       Literals.parseUint16       string (optional uint16),+  prim1 DefLiterals.parseUint32       Literals.parseUint32       string (optional uint32),+  prim1 DefLiterals.parseUint64       Literals.parseUint64       string (optional uint64),+  prim1 DefLiterals.printBigint       Literals.printBigint       bigint string,   prim1 DefLiterals.printBoolean       Literals.printBoolean       boolean string,-  prim1 DefLiterals.showDecimal       Literals.showDecimal       decimal string,-  prim1 DefLiterals.showFloat32       Literals.showFloat32       float32 string,-  prim1 DefLiterals.showFloat64       Literals.showFloat64       float64 string,-  prim1 DefLiterals.showInt8          Literals.showInt8          int8 string,-  prim1 DefLiterals.showInt16         Literals.showInt16         int16 string,-  prim1 DefLiterals.showInt32         Literals.showInt32         int32 string,-  prim1 DefLiterals.showInt64         Literals.showInt64         int64 string,+  prim1 DefLiterals.printDecimal      Literals.printDecimal      decimal string,+  prim1 DefLiterals.printFloat32      Literals.printFloat32      float32 string,+  prim1 DefLiterals.printFloat64      Literals.printFloat64      float64 string,+  prim1 DefLiterals.printInt8         Literals.printInt8         int8 string,+  prim1 DefLiterals.printInt16        Literals.printInt16        int16 string,+  prim1 DefLiterals.printInt32        Literals.printInt32        int32 string,+  prim1 DefLiterals.printInt64        Literals.printInt64        int64 string,   prim1 DefLiterals.printString        Literals.printString        string string,-  prim1 DefLiterals.showUint8         Literals.showUint8         uint8 string,-  prim1 DefLiterals.showUint16        Literals.showUint16        uint16 string,-  prim1 DefLiterals.showUint32        Literals.showUint32        uint32 string,-  prim1 DefLiterals.showUint64        Literals.showUint64        uint64 string,+  prim1 DefLiterals.printUint8        Literals.printUint8        uint8 string,+  prim1 DefLiterals.printUint16       Literals.printUint16       uint16 string,+  prim1 DefLiterals.printUint32       Literals.printUint32       uint32 string,+  prim1 DefLiterals.printUint64       Literals.printUint64       uint64 string,   prim1 DefLiterals.base64ToBinary    Literals.base64ToBinary    string binary,   prim1 DefLiterals.uint8ToBigint     Literals.uint8ToBigint     uint8 bigint,   prim1 DefLiterals.uint16ToBigint    Literals.uint16ToBigint    uint16 bigint,@@ -306,7 +307,7 @@     prim2     DefMaps.map             Maps.map               (funT v1_ v2_) (Prims.map k_ v1_) (Prims.map k_ v2_),     prim2     DefMaps.mapKeys         Maps.mapKeys           (fun k1_ k2_) (Prims.map k1_ v_) (Prims.map k2_ v_),     prim2     DefMaps.member          Maps.member            k_ mapKv boolean,-    prim1     DefMaps.null            Maps.null              mapKv boolean,+    prim1     DefMaps.isEmpty         Maps.isEmpty           mapKv boolean,     prim2     DefMaps.singleton       Maps.singleton         k_ v_ mapKv,     prim1     DefMaps.size            Maps.size              mapKv int32,     prim1     DefMaps.toList          Maps.toList            mapKv (list $ pair k_ v_),@@ -386,7 +387,7 @@     prim2     DefOptionals.mapList   Optionals.mapList      (fun x_ (optional y_)) (list x_) (optional (list y_)),     prim2     DefOptionals.mapOptional  Optionals.mapOptional     (fun x_ $ optional y_) (list x_) (list y_),     prim2     DefOptionals.mapSet    Optionals.mapSet       (fun x_ (optional y_)) (set x_) (optional (set y_)),-    prim1     DefOptionals.pure      Optionals.pure         x_ (optional x_),+    prim1     DefOptionals.given     Optionals.given        x_ (optional x_),     prim1     DefOptionals.toList    Optionals.toList       (optional x_) (list x_),     prim2 DefOptionals.withDefault Optionals.withDefault    x_ (optional x_) x_] @@ -394,6 +395,7 @@ hydraLibPairs = standardLibrary [     prim3     DefPairs.bimap  Pairs.bimap      (funT a_ c_) (funT b_ d_) (pair a_ b_) (pair c_ d_),     prim1     DefPairs.first  Pairs.first      (pair a_ b_) a_,+    prim2     DefPairs.pair   Pairs.pair       a_ b_ (pair a_ b_),     prim1     DefPairs.second Pairs.second     (pair a_ b_) b_]  hydraLibRegex :: Library@@ -416,7 +418,7 @@     prim2     DefSets.intersection Sets.intersection (set x_) (set x_) (set x_),     prim2     DefSets.map          Sets.map          (fun x_ y_) (set x_) (set y_),     prim2     DefSets.member       Sets.member       x_ (set x_) boolean,-    prim1     DefSets.null         Sets.null         (set x_) boolean,+    prim1     DefSets.isEmpty      Sets.isEmpty      (set x_) boolean,     prim1     DefSets.singleton    Sets.singleton    x_ (set x_),     prim1     DefSets.size         Sets.size         (set x_) int32,     prim1     DefSets.toList       Sets.toList       (set x_) (list x_),@@ -435,7 +437,7 @@   prim2 DefStrings.join        Strings.join        string (list string) string,   prim1 DefStrings.length      Strings.length      string int32,   prim2 DefStrings.charAt Strings.charAt int32 string (optional int32),-  prim1 DefStrings.null        Strings.null        string boolean,+  prim1 DefStrings.isEmpty     Strings.isEmpty     string boolean,   prim2 DefStrings.splitOn     Strings.splitOn     string string (list string),   prim1 DefStrings.toList      Strings.toList      string (list int32),   prim1 DefStrings.toLower     Strings.toLower     string string,
src/main/haskell/Hydra/Packaging.hs view
@@ -8,6 +8,7 @@ import qualified Hydra.Typing as Typing import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | A definition, which may be either a term, type, or primitive definition data Definition =
src/main/haskell/Hydra/Parse/Docs.hs view
@@ -1,6 +1,6 @@ -- Note: this is an automatically generated file. Do not edit. --- | Parser for Hydra documentation strings, producing DocSegment lists+-- | Parser for Hydra documentation strings, producing DocSegment lists. A bespoke helper parser, not a parse<T> convention function (see docs/specification/index.md, Conventions).  module Hydra.Parse.Docs where @@ -40,6 +40,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Parse the content between the doc-escape delimiters into an EntityReference. The input is the inner content (tag and optional rhs), e.g. "type hydra.core.Lambda". Returns nothing for unrecognized tags. parseDocAnnotation :: String -> Maybe Packaging.EntityReference
src/main/haskell/Hydra/Parse/Regex.hs view
@@ -1,6 +1,6 @@ -- Note: this is an automatically generated file. Do not edit. --- | Parser for Hydra's translingual regular-expression syntax (docs/specification/regex.md): text -> hydra.regex AST. Built on the hydra.parsers combinators. Rejects ill-formed patterns (empty alternation branches, empty classes, out-of-range code points) via the ParseResult failure channel, so 'well-formed' is portable across hosts. See issue #567.+-- | Parser for Hydra's translingual regular-expression syntax (docs/specification/regex.md): text -> hydra.regex AST. Built on the hydra.parsers combinators. Rejects ill-formed patterns (empty alternation branches, empty classes, out-of-range code points) via the ParseResult failure channel, so 'well-formed' is portable across hosts. See issue #567. A structured textual-syntax parser (precedent for the general parser in #497), not a scalar parse<T> convention function (see docs/specification/index.md, Conventions).  module Hydra.Parse.Regex where @@ -42,12 +42,13 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Parse an alternation of sequences separated by |. When there is more than one branch, each branch must be non-empty; empty branches (a|, |b, a||b, and the nested (a|)) are rejected at every level. A single empty branch is the legal empty case (empty whole pattern / empty group). alternation :: Parsing.Parser [[Regex.Quantified]] alternation =     Parsers.bind (Parsers.sepBy1 regexSequence (Parsers.char 124)) (\branches ->-      let hasEmpty = Lists.foldl (\acc -> \b -> Logic.or acc (Lists.null b)) False branches+      let hasEmpty = Lists.foldl (\acc -> \b -> Logic.or acc (Lists.isEmpty b)) False branches           multi = Ordering.gt (Lists.length branches) 1       in (Logic.ifElse (Logic.and hasEmpty multi) (Parsers.fail "empty alternation branch") (Parsers.pure branches))) @@ -111,7 +112,7 @@ parseRegex :: String -> Maybe [[Regex.Quantified]] parseRegex input =     (\x -> case x of-      Parsing.ParseResultSuccess v0 -> Logic.ifElse (Lists.null (Parsing.parseSuccessRemainder v0)) (Just (Parsing.parseSuccessValue v0)) Nothing+      Parsing.ParseResultSuccess v0 -> Logic.ifElse (Lists.isEmpty (Parsing.parseSuccessRemainder v0)) (Just (Parsing.parseSuccessValue v0)) Nothing       Parsing.ParseResultFailure _ -> Nothing) (Parsers.runParser regex input)  -- | Parse an atom followed by an optional quantifier.
src/main/haskell/Hydra/Parsers.hs view
@@ -1,6 +1,6 @@ -- Note: this is an automatically generated file. Do not edit. --- | General-purpose parser combinators+-- | General-purpose parser combinators, operating on a Parser type. A helper library, not a set of parse<T> convention functions (see docs/specification/index.md, Conventions).  module Hydra.Parsers where @@ -41,6 +41,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Try the first parser; if it fails without consuming input, try the second alt :: Parsing.Parser t0 -> Parsing.Parser t0 -> Parsing.Parser t0@@ -95,7 +96,7 @@ -- | A parser that succeeds only at the end of input eof :: Parsing.Parser () eof =-    Parsing.Parser (\input -> Logic.ifElse (Lists.null input) (Parsing.ParseResultSuccess (Parsing.ParseSuccess {+    Parsing.Parser (\input -> Logic.ifElse (Lists.isEmpty input) (Parsing.ParseResultSuccess (Parsing.ParseSuccess {       Parsing.parseSuccessValue = (),       Parsing.parseSuccessRemainder = input})) (Parsing.ParseResultFailure (Parsing.ParseError {       Parsing.parseErrorMessage = "expected end of input",@@ -142,7 +143,7 @@  -- | Optionally parse something, returning Nothing if it fails optional :: Parsing.Parser t0 -> Parsing.Parser (Maybe t0)-optional p = alt (map Optionals.pure p) (pure Nothing)+optional p = alt (map Optionals.given p) (pure Nothing)  -- | A parser that always succeeds with the given value without consuming input pure :: t0 -> Parsing.Parser t0
src/main/haskell/Hydra/Parsing.hs view
@@ -7,6 +7,7 @@ import qualified Hydra.Core as Core import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | An error which occurred while parsing data ParseError =
src/main/haskell/Hydra/Paths.hs view
@@ -1,67 +1,93 @@ -- Note: this is an automatically generated file. Do not edit. --- | A model for subterm and subtype access patterns+-- | Subterm and subtype access, and the link view of a graph  module Hydra.Paths where  import qualified Hydra.Core as Core import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void --- | An edge in a subterm graph, connecting two nodes via a path+-- | A link from a node to a non-term attribute of a position+data SubtermAttribute =+  SubtermAttribute {+    -- | The subterm path at which the attribute occurs+    subtermAttributePath :: SubtermPath,+    -- | The attribute value+    subtermAttributeTarget :: TermAttribute}+  deriving (Eq, Ord, Read, Show)++_SubtermAttribute = Core.Name "hydra.paths.SubtermAttribute"++_SubtermAttribute_path = Core.Name "path"++_SubtermAttribute_target = Core.Name "target"++-- | A link from a node to another binding of the graph, addressed by the path at which it occurs data SubtermEdge =   SubtermEdge {-    -- | The source node of the edge-    subtermEdgeSource :: SubtermNode,-    -- | The subterm path connecting source to target+    -- | The subterm path at which the reference occurs     subtermEdgePath :: SubtermPath,-    -- | The target node of the edge-    subtermEdgeTarget :: SubtermNode}+    -- | The name of the referenced binding of the graph+    subtermEdgeTarget :: Core.Name}   deriving (Eq, Ord, Read, Show)  _SubtermEdge = Core.Name "hydra.paths.SubtermEdge" -_SubtermEdge_source = Core.Name "source"- _SubtermEdge_path = Core.Name "path"  _SubtermEdge_target = Core.Name "target" --- | A graph of subterm nodes and edges, representing term access patterns+-- | The link view of a graph as subterm nodes and their links data SubtermGraph =   SubtermGraph {     -- | All nodes in the graph-    subtermGraphNodes :: [SubtermNode],-    -- | All edges in the graph-    subtermGraphEdges :: [SubtermEdge]}+    subtermGraphNodes :: [SubtermNode]}   deriving (Eq, Ord, Read, Show)  _SubtermGraph = Core.Name "hydra.paths.SubtermGraph"  _SubtermGraph_nodes = Core.Name "nodes" -_SubtermGraph_edges = Core.Name "edges"+-- | An outgoing link of a subterm node: an edge, a property, or an attribute+data SubtermLink =+  -- | A reference to another binding of the graph+  SubtermLinkEdge SubtermEdge |+  -- | A leaf term+  SubtermLinkProperty SubtermProperty |+  -- | A non-term attribute of a position+  SubtermLinkAttribute SubtermAttribute+  deriving (Eq, Ord, Read, Show) --- | A node in a subterm graph, representing a term or subterm+_SubtermLink = Core.Name "hydra.paths.SubtermLink"++_SubtermLink_edge = Core.Name "edge"++_SubtermLink_property = Core.Name "property"++_SubtermLink_attribute = Core.Name "attribute"++-- | A node in a subterm graph: a binding of the graph, with its type scheme and outgoing links data SubtermNode =   SubtermNode {-    -- | The qualified name of the term+    -- | The name of the binding     subtermNodeName :: Core.Name,-    -- | A human-readable label for the node-    subtermNodeLabel :: String,-    -- | A unique identifier for the node-    subtermNodeId :: String}+    -- | The type scheme of the binding+    subtermNodeType :: Core.TypeScheme,+    -- | The outgoing links of the node+    subtermNodeLinks :: [SubtermLink]}   deriving (Eq, Ord, Read, Show)  _SubtermNode = Core.Name "hydra.paths.SubtermNode"  _SubtermNode_name = Core.Name "name" -_SubtermNode_label = Core.Name "label"+_SubtermNode_type = Core.Name "type" -_SubtermNode_id = Core.Name "id"+_SubtermNode_links = Core.Name "links" --- | A sequence of subterm steps forming a path through a term+-- | A sequence of subterm steps forming a path through a term, root first newtype SubtermPath =   SubtermPath {     unSubtermPath :: [SubtermStep]}@@ -69,146 +95,194 @@  _SubtermPath = Core.Name "hydra.paths.SubtermPath" +-- | A link from a node to a leaf term (literal, unit, projection, unwrap, or an unbound variable)+data SubtermProperty =+  SubtermProperty {+    -- | The subterm path at which the leaf term occurs+    subtermPropertyPath :: SubtermPath,+    -- | The leaf term+    subtermPropertyTarget :: Core.Term}+  deriving (Eq, Ord, Read, Show)++_SubtermProperty = Core.Name "hydra.paths.SubtermProperty"++_SubtermProperty_path = Core.Name "path"++_SubtermProperty_target = Core.Name "target"+ -- | A function which maps from a term to a particular immediate subterm data SubtermStep =+  -- | Access the annotation of an annotated term+  SubtermStepAnnotatedAnnotation |   -- | Access the body of an annotated term   SubtermStepAnnotatedBody |-  -- | Access the function of an application term-  SubtermStepApplicationFunction |   -- | Access the argument of an application term   SubtermStepApplicationArgument |+  -- | Access the function of an application term+  SubtermStepApplicationFunction |+  -- | Access the handler of a specific case of a case statement by field name+  SubtermStepCasesCase Core.Name |+  -- | Access the default case of a case statement+  SubtermStepCasesDefault |+  -- | Access the left term of an either value+  SubtermStepEitherLeft |+  -- | Access the right term of an either value+  SubtermStepEitherRight |+  -- | Access the injected term of a union injection by field name+  SubtermStepInjectField Core.Name |   -- | Access the body of a lambda term   SubtermStepLambdaBody |-  -- | Access the default case of a union elimination-  SubtermStepUnionCasesDefault |-  -- | Access a specific branch of a union elimination by field name-  SubtermStepUnionCasesBranch Core.Name |-  -- | Access the body of a let term-  SubtermStepLetBody |   -- | Access a specific binding in a let term by variable name   SubtermStepLetBinding Core.Name |+  -- | Access the body of a let term+  SubtermStepLetBody |   -- | Access an element of a list by index   SubtermStepListElement Int |-  -- | Access a key in a map by index+  -- | Access the key of the map entry at the given index   SubtermStepMapKey Int |-  -- | Access a value in a map by index+  -- | Access the value of the map entry at the given index   SubtermStepMapValue Int |   -- | Access the term inside a given (present) optional value-  SubtermStepOptionalTerm |-  -- | Access an element of a product (tuple) by index-  SubtermStepProductTerm Int |+  SubtermStepOptionalGiven |+  -- | Access the first term of a pair+  SubtermStepPairFirst |+  -- | Access the second term of a pair+  SubtermStepPairSecond |   -- | Access a field of a record by field name   SubtermStepRecordField Core.Name |   -- | Access an element of a set by index   SubtermStepSetElement Int |-  -- | Access the term inside a sum variant-  SubtermStepSumTerm |+  -- | Access the body of a type application term+  SubtermStepTypeApplicationBody |   -- | Access the body of a type lambda term   SubtermStepTypeLambdaBody |-  -- | Access the term being applied to a type-  SubtermStepTypeApplicationTerm |-  -- | Access the term inside a union injection-  SubtermStepInjectionTerm |-  -- | Access the term inside a wrapped term-  SubtermStepWrappedTerm+  -- | Access the body of a wrapped term+  SubtermStepWrapBody   deriving (Eq, Ord, Read, Show)  _SubtermStep = Core.Name "hydra.paths.SubtermStep" +_SubtermStep_annotatedAnnotation = Core.Name "annotatedAnnotation"+ _SubtermStep_annotatedBody = Core.Name "annotatedBody" +_SubtermStep_applicationArgument = Core.Name "applicationArgument"+ _SubtermStep_applicationFunction = Core.Name "applicationFunction" -_SubtermStep_applicationArgument = Core.Name "applicationArgument"+_SubtermStep_casesCase = Core.Name "casesCase" -_SubtermStep_lambdaBody = Core.Name "lambdaBody"+_SubtermStep_casesDefault = Core.Name "casesDefault" -_SubtermStep_unionCasesDefault = Core.Name "unionCasesDefault"+_SubtermStep_eitherLeft = Core.Name "eitherLeft" -_SubtermStep_unionCasesBranch = Core.Name "unionCasesBranch"+_SubtermStep_eitherRight = Core.Name "eitherRight" -_SubtermStep_letBody = Core.Name "letBody"+_SubtermStep_injectField = Core.Name "injectField" +_SubtermStep_lambdaBody = Core.Name "lambdaBody"+ _SubtermStep_letBinding = Core.Name "letBinding" +_SubtermStep_letBody = Core.Name "letBody"+ _SubtermStep_listElement = Core.Name "listElement"  _SubtermStep_mapKey = Core.Name "mapKey"  _SubtermStep_mapValue = Core.Name "mapValue" -_SubtermStep_optionalTerm = Core.Name "optionalTerm"+_SubtermStep_optionalGiven = Core.Name "optionalGiven" -_SubtermStep_productTerm = Core.Name "productTerm"+_SubtermStep_pairFirst = Core.Name "pairFirst" +_SubtermStep_pairSecond = Core.Name "pairSecond"+ _SubtermStep_recordField = Core.Name "recordField"  _SubtermStep_setElement = Core.Name "setElement" -_SubtermStep_sumTerm = Core.Name "sumTerm"+_SubtermStep_typeApplicationBody = Core.Name "typeApplicationBody"  _SubtermStep_typeLambdaBody = Core.Name "typeLambdaBody" -_SubtermStep_typeApplicationTerm = Core.Name "typeApplicationTerm"+_SubtermStep_wrapBody = Core.Name "wrapBody" -_SubtermStep_injectionTerm = Core.Name "injectionTerm"+-- | A link from a node to a non-type attribute of a position+data SubtypeAttribute =+  SubtypeAttribute {+    -- | The subtype path at which the attribute occurs+    subtypeAttributePath :: SubtypePath,+    -- | The attribute value+    subtypeAttributeTarget :: TypeAttribute}+  deriving (Eq, Ord, Read, Show) -_SubtermStep_wrappedTerm = Core.Name "wrappedTerm"+_SubtypeAttribute = Core.Name "hydra.paths.SubtypeAttribute" --- | An edge in a subtype graph, connecting two nodes via a path+_SubtypeAttribute_path = Core.Name "path"++_SubtypeAttribute_target = Core.Name "target"++-- | A link from a node to a named type, addressed by the path at which it occurs data SubtypeEdge =   SubtypeEdge {-    -- | The source node of the edge-    subtypeEdgeSource :: SubtypeNode,-    -- | The subtype path connecting source to target+    -- | The subtype path at which the reference occurs     subtypeEdgePath :: SubtypePath,-    -- | The target node of the edge-    subtypeEdgeTarget :: SubtypeNode}+    -- | The name of the referenced type+    subtypeEdgeTarget :: Core.Name}   deriving (Eq, Ord, Read, Show)  _SubtypeEdge = Core.Name "hydra.paths.SubtypeEdge" -_SubtypeEdge_source = Core.Name "source"- _SubtypeEdge_path = Core.Name "path"  _SubtypeEdge_target = Core.Name "target" --- | A graph of subtype nodes and edges, representing type access patterns+-- | The link view of a schema as subtype nodes and their links data SubtypeGraph =   SubtypeGraph {     -- | All nodes in the graph-    subtypeGraphNodes :: [SubtypeNode],-    -- | All edges in the graph-    subtypeGraphEdges :: [SubtypeEdge]}+    subtypeGraphNodes :: [SubtypeNode]}   deriving (Eq, Ord, Read, Show)  _SubtypeGraph = Core.Name "hydra.paths.SubtypeGraph"  _SubtypeGraph_nodes = Core.Name "nodes" -_SubtypeGraph_edges = Core.Name "edges"+-- | An outgoing link of a subtype node: an edge, a property, or an attribute+data SubtypeLink =+  -- | A reference to a named type+  SubtypeLinkEdge SubtypeEdge |+  -- | A leaf type+  SubtypeLinkProperty SubtypeProperty |+  -- | A non-type attribute of a position+  SubtypeLinkAttribute SubtypeAttribute+  deriving (Eq, Ord, Read, Show) --- | A node in a subtype graph, representing a type or subtype+_SubtypeLink = Core.Name "hydra.paths.SubtypeLink"++_SubtypeLink_edge = Core.Name "edge"++_SubtypeLink_property = Core.Name "property"++_SubtypeLink_attribute = Core.Name "attribute"++-- | A node in a subtype graph: a named type, with its outgoing links data SubtypeNode =   SubtypeNode {-    -- | The qualified name of the type+    -- | The name of the type     subtypeNodeName :: Core.Name,-    -- | A human-readable label for the node-    subtypeNodeLabel :: String,-    -- | A unique identifier for the node-    subtypeNodeId :: String}+    -- | The outgoing links of the node+    subtypeNodeLinks :: [SubtypeLink]}   deriving (Eq, Ord, Read, Show)  _SubtypeNode = Core.Name "hydra.paths.SubtypeNode"  _SubtypeNode_name = Core.Name "name" -_SubtypeNode_label = Core.Name "label"--_SubtypeNode_id = Core.Name "id"+_SubtypeNode_links = Core.Name "links" --- | A sequence of subtype steps forming a path through a type+-- | A sequence of subtype steps forming a path through a type, root first newtype SubtypePath =   SubtypePath {     unSubtypePath :: [SubtypeStep]}@@ -216,24 +290,41 @@  _SubtypePath = Core.Name "hydra.paths.SubtypePath" +-- | A link from a node to a leaf type (literal, unit, void, or a bound variable)+data SubtypeProperty =+  SubtypeProperty {+    -- | The subtype path at which the leaf type occurs+    subtypePropertyPath :: SubtypePath,+    -- | The leaf type+    subtypePropertyTarget :: Core.Type}+  deriving (Eq, Ord, Read, Show)++_SubtypeProperty = Core.Name "hydra.paths.SubtypeProperty"++_SubtypeProperty_path = Core.Name "path"++_SubtypeProperty_target = Core.Name "target"+ -- | A function which maps from a type to a particular immediate subtype data SubtypeStep =-  -- | Access the body of an annotated type+  -- | Access the body of an annotated type (the annotation is a term; there is no step for it)   SubtypeStepAnnotatedBody |-  -- | Access the function of an application type-  SubtypeStepApplicationFunction |   -- | Access the argument of an application type   SubtypeStepApplicationArgument |+  -- | Access the function of an application type+  SubtypeStepApplicationFunction |+  -- | Access the value type of an effect type+  SubtypeStepEffectValue |   -- | Access the left type of an either type   SubtypeStepEitherLeft |   -- | Access the right type of an either type   SubtypeStepEitherRight |   -- | Access the body of a universally quantified type   SubtypeStepForallBody |-  -- | Access the domain type of a function type-  SubtypeStepFunctionDomain |   -- | Access the codomain type of a function type   SubtypeStepFunctionCodomain |+  -- | Access the domain type of a function type+  SubtypeStepFunctionDomain |   -- | Access the element type of a list type   SubtypeStepListElement |   -- | Access the key type of a map type@@ -252,17 +343,19 @@   SubtypeStepSetElement |   -- | Access a field type of a union type by field name   SubtypeStepUnionField Core.Name |-  -- | Access the type inside a wrapped type-  SubtypeStepWrappedType+  -- | Access the body type of a wrapped type+  SubtypeStepWrapBody   deriving (Eq, Ord, Read, Show)  _SubtypeStep = Core.Name "hydra.paths.SubtypeStep"  _SubtypeStep_annotatedBody = Core.Name "annotatedBody" +_SubtypeStep_applicationArgument = Core.Name "applicationArgument"+ _SubtypeStep_applicationFunction = Core.Name "applicationFunction" -_SubtypeStep_applicationArgument = Core.Name "applicationArgument"+_SubtypeStep_effectValue = Core.Name "effectValue"  _SubtypeStep_eitherLeft = Core.Name "eitherLeft" @@ -270,10 +363,10 @@  _SubtypeStep_forallBody = Core.Name "forallBody" -_SubtypeStep_functionDomain = Core.Name "functionDomain"- _SubtypeStep_functionCodomain = Core.Name "functionCodomain" +_SubtypeStep_functionDomain = Core.Name "functionDomain"+ _SubtypeStep_listElement = Core.Name "listElement"  _SubtypeStep_mapKeys = Core.Name "mapKeys"@@ -292,4 +385,68 @@  _SubtypeStep_unionField = Core.Name "unionField" -_SubtypeStep_wrappedType = Core.Name "wrappedType"+_SubtypeStep_wrapBody = Core.Name "wrapBody"++-- | A non-term constituent of the term at a path, together with its value+data TermAttribute =+  -- | The name of the union type eliminated by a case statement+  TermAttributeCasesTypeName Core.Name |+  -- | The name of the union type of an injection+  TermAttributeInjectTypeName Core.Name |+  -- | The (given) domain type of a lambda+  TermAttributeLambdaDomainGiven Core.Type |+  -- | The parameter name of a lambda+  TermAttributeLambdaParameter Core.Name |+  -- | The name of a let binding together with its (given) type scheme+  TermAttributeLetBindingTypeSchemeGiven (Core.Name, Core.TypeScheme) |+  -- | The name of the field projected by a projection+  TermAttributeProjectFieldName Core.Name |+  -- | The name of the record type of a projection+  TermAttributeProjectTypeName Core.Name |+  -- | The name of the record type of a record term+  TermAttributeRecordTypeName Core.Name |+  -- | The type argument of a type application term+  TermAttributeTypeApplicationType Core.Type |+  -- | The type-variable parameter of a type lambda term+  TermAttributeTypeLambdaParameter Core.Name |+  -- | The name of the wrapper type of a wrapped term+  TermAttributeWrapTypeName Core.Name+  deriving (Eq, Ord, Read, Show)++_TermAttribute = Core.Name "hydra.paths.TermAttribute"++_TermAttribute_casesTypeName = Core.Name "casesTypeName"++_TermAttribute_injectTypeName = Core.Name "injectTypeName"++_TermAttribute_lambdaDomainGiven = Core.Name "lambdaDomainGiven"++_TermAttribute_lambdaParameter = Core.Name "lambdaParameter"++_TermAttribute_letBindingTypeSchemeGiven = Core.Name "letBindingTypeSchemeGiven"++_TermAttribute_projectFieldName = Core.Name "projectFieldName"++_TermAttribute_projectTypeName = Core.Name "projectTypeName"++_TermAttribute_recordTypeName = Core.Name "recordTypeName"++_TermAttribute_typeApplicationType = Core.Name "typeApplicationType"++_TermAttribute_typeLambdaParameter = Core.Name "typeLambdaParameter"++_TermAttribute_wrapTypeName = Core.Name "wrapTypeName"++-- | A non-type constituent of the type at a path, together with its value+data TypeAttribute =+  -- | The annotation of an annotated type (a term; not descended into)+  TypeAttributeAnnotatedAnnotation Core.Term |+  -- | The type-variable parameter of a universally quantified type+  TypeAttributeForallParameter Core.Name+  deriving (Eq, Ord, Read, Show)++_TypeAttribute = Core.Name "hydra.paths.TypeAttribute"++_TypeAttribute_annotatedAnnotation = Core.Name "annotatedAnnotation"++_TypeAttribute_forallParameter = Core.Name "forallParameter"
src/main/haskell/Hydra/Predicates.hs view
@@ -54,6 +54,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | Check if a binding needs to be treated as a function@@ -63,7 +64,7 @@       let term = Core.bindingTerm b           mts = Core.bindingTypeScheme b       in (Optionals.match mts (isComplexTerm tc term) (\ts ->-        let isPolymorphic = Logic.not (Lists.null (Core.typeSchemeVariables ts))+        let isPolymorphic = Logic.not (Lists.isEmpty (Core.typeSchemeVariables ts))             isNonNullary = Ordering.gt (Arity.typeArity (Core.typeSchemeBody ts)) 0             isComplex = isComplexTerm tc term         in (Logic.or (Logic.or isPolymorphic isNonNullary) isComplex)))@@ -127,7 +128,7 @@       Core.TypeForall v0 -> isNominalType (Core.forallTypeBody v0)       _ -> False --- | Check if an element is serializable (no function types in dependencies) (Either version)+-- | Check if an element is serializable (no function, effect, or void types in dependencies) (Either version) isSerializable :: t0 -> Graph.Graph -> Core.Binding -> Either Errors.Error Bool isSerializable cx graph el = @@ -135,9 +136,9 @@               \typ -> Lists.map Reflect.typeVariant (Rewriting.foldOverType Coders.TraversalOrderPre (\m -> \t -> Lists.cons t m) [] typ)       in (Eithers.map (\deps ->         let allVariants = Sets.fromList (Lists.concat (Lists.map variants (Maps.elems deps)))-        in (Logic.not (Logic.or (Sets.member Variants.TypeVariantEffect allVariants) (Sets.member Variants.TypeVariantFunction allVariants)))) (typeDependencies cx graph False Functions.identity (Core.bindingName el)))+        in (Logic.not (Logic.or (Sets.member Variants.TypeVariantEffect allVariants) (Logic.or (Sets.member Variants.TypeVariantFunction allVariants) (Sets.member Variants.TypeVariantVoid allVariants))))) (typeDependencies cx graph False Functions.identity (Core.bindingName el))) --- | Check if a type (by name) is serializable, resolving all type dependencies (Either version)+-- | Check if a type (by name) is serializable, resolving all type dependencies (no function, effect, or void types) (Either version) isSerializableByName :: t0 -> Graph.Graph -> Core.Name -> Either Errors.Error Bool isSerializableByName cx graph name = @@ -145,15 +146,15 @@               \typ -> Lists.map Reflect.typeVariant (Rewriting.foldOverType Coders.TraversalOrderPre (\m -> \t -> Lists.cons t m) [] typ)       in (Eithers.map (\deps ->         let allVariants = Sets.fromList (Lists.concat (Lists.map variants (Maps.elems deps)))-        in (Logic.not (Logic.or (Sets.member Variants.TypeVariantEffect allVariants) (Sets.member Variants.TypeVariantFunction allVariants)))) (typeDependencies cx graph False Functions.identity name))+        in (Logic.not (Logic.or (Sets.member Variants.TypeVariantEffect allVariants) (Logic.or (Sets.member Variants.TypeVariantFunction allVariants) (Sets.member Variants.TypeVariantVoid allVariants))))) (typeDependencies cx graph False Functions.identity name)) --- | Check if a type is serializable (no function types in the type itself)+-- | Check if a type is serializable (no function, effect, or void types in the type itself) isSerializableType :: Core.Type -> Bool isSerializableType typ =        let allVariants =               Sets.fromList (Lists.map Reflect.typeVariant (Rewriting.foldOverType Coders.TraversalOrderPre (\m -> \t -> Lists.cons t m) [] typ))-      in (Logic.not (Logic.or (Sets.member Variants.TypeVariantEffect allVariants) (Sets.member Variants.TypeVariantFunction allVariants)))+      in (Logic.not (Logic.or (Sets.member Variants.TypeVariantEffect allVariants) (Logic.or (Sets.member Variants.TypeVariantFunction allVariants) (Sets.member Variants.TypeVariantVoid allVariants))))  -- | Check if a term is trivially cheap (no thunking needed) isTrivialTerm :: Core.Term -> Bool@@ -210,7 +211,7 @@                 in (Eithers.bind (Lexical.requireBinding graph name2) (\el -> Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\_a -> _a) (DecodeCore.type_ graph (Core.bindingTerm el))))           toPair = \name2 -> Eithers.map (\typ -> (name2, (transform typ))) (requireType name2)           deps =-                  \seeds -> \names -> Logic.ifElse (Sets.null seeds) (Right names) (Eithers.bind (Eithers.mapList toPair (Sets.toList seeds)) (\pairs ->+                  \seeds -> \names -> Logic.ifElse (Sets.isEmpty seeds) (Right names) (Eithers.bind (Eithers.mapList toPair (Sets.toList seeds)) (\pairs ->                     let newNames = Maps.union names (Maps.fromList pairs)                         refs =                                 Lists.foldl Sets.union Sets.empty (Lists.map (\pair -> Dependencies.typeDependencyNames withSchema (Pairs.second pair)) pairs)
src/main/haskell/Hydra/Print/Core.hs view
@@ -44,6 +44,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S @@ -131,8 +132,8 @@ float :: Core.FloatValue -> String float fv =     case fv of-      Core.FloatValueFloat32 v0 -> Strings.concat2 (Literals.showFloat32 v0) ":float32"-      Core.FloatValueFloat64 v0 -> Strings.concat2 (Literals.showFloat64 v0) ":float64"+      Core.FloatValueFloat32 v0 -> Strings.concat2 (Literals.printFloat32 v0) ":float32"+      Core.FloatValueFloat64 v0 -> Strings.concat2 (Literals.printFloat64 v0) ":float64"  -- | Show a float type as a string floatType :: Core.FloatType -> String@@ -158,15 +159,15 @@ integer :: Core.IntegerValue -> String integer iv =     case iv of-      Core.IntegerValueBigint v0 -> Strings.concat2 (Literals.showBigint v0) ":bigint"-      Core.IntegerValueInt8 v0 -> Strings.concat2 (Literals.showInt8 v0) ":int8"-      Core.IntegerValueInt16 v0 -> Strings.concat2 (Literals.showInt16 v0) ":int16"-      Core.IntegerValueInt32 v0 -> Strings.concat2 (Literals.showInt32 v0) ":int32"-      Core.IntegerValueInt64 v0 -> Strings.concat2 (Literals.showInt64 v0) ":int64"-      Core.IntegerValueUint8 v0 -> Strings.concat2 (Literals.showUint8 v0) ":uint8"-      Core.IntegerValueUint16 v0 -> Strings.concat2 (Literals.showUint16 v0) ":uint16"-      Core.IntegerValueUint32 v0 -> Strings.concat2 (Literals.showUint32 v0) ":uint32"-      Core.IntegerValueUint64 v0 -> Strings.concat2 (Literals.showUint64 v0) ":uint64"+      Core.IntegerValueBigint v0 -> Strings.concat2 (Literals.printBigint v0) ":bigint"+      Core.IntegerValueInt8 v0 -> Strings.concat2 (Literals.printInt8 v0) ":int8"+      Core.IntegerValueInt16 v0 -> Strings.concat2 (Literals.printInt16 v0) ":int16"+      Core.IntegerValueInt32 v0 -> Strings.concat2 (Literals.printInt32 v0) ":int32"+      Core.IntegerValueInt64 v0 -> Strings.concat2 (Literals.printInt64 v0) ":int64"+      Core.IntegerValueUint8 v0 -> Strings.concat2 (Literals.printUint8 v0) ":uint8"+      Core.IntegerValueUint16 v0 -> Strings.concat2 (Literals.printUint16 v0) ":uint16"+      Core.IntegerValueUint32 v0 -> Strings.concat2 (Literals.printUint32 v0) ":uint32"+      Core.IntegerValueUint64 v0 -> Strings.concat2 (Literals.printUint64 v0) ":uint64"  -- | Show an integer type as a string integerType :: Core.IntegerType -> String@@ -226,7 +227,7 @@     case l of       Core.LiteralBinary _ -> "[binary]"       Core.LiteralBoolean v0 -> Logic.ifElse v0 "true" "false"-      Core.LiteralDecimal v0 -> Literals.showDecimal v0+      Core.LiteralDecimal v0 -> Literals.printDecimal v0       Core.LiteralFloat v0 -> float v0       Core.LiteralInteger v0 -> integer v0       Core.LiteralString v0 -> Literals.printString v0@@ -512,7 +513,7 @@           body = Core.typeSchemeBody ts           varNames = Lists.map Core.unName vars           fa =-                  Logic.ifElse (Lists.null vars) "" (Strings.concat [+                  Logic.ifElse (Lists.isEmpty vars) "" (Strings.concat [                     "forall ",                     (Strings.join "," varNames),                     ". "])@@ -523,12 +524,12 @@                     " ",                     (Core.unName v)]           toConstraintPairs =-                  \p -> Lists.map (toConstraintPair (Pairs.first p)) (Core.typeVariableConstraintsClasses (Pairs.second p))-          tc = Optionals.match (Core.typeSchemeConstraints ts) [] (\m -> Lists.concat (Lists.map toConstraintPairs (Maps.toList m)))+                  \p -> Lists.map (toConstraintPair (Pairs.first p)) (Sets.toList (Core.typeVariableConstraintsClasses (Pairs.second p)))+          tc = Lists.concat (Lists.map toConstraintPairs (Maps.toList (Core.typeSchemeConstraints ts)))       in (Strings.concat [         "(",         fa,-        (Logic.ifElse (Lists.null tc) "" (Strings.concat [+        (Logic.ifElse (Lists.isEmpty tc) "" (Strings.concat [           "(",           (Strings.join ", " tc),           ") => "])),
src/main/haskell/Hydra/Print/Docs.hs view
@@ -38,6 +38,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Render a DefinitionReference as its fully-qualified name definitionReference :: Packaging.DefinitionReference -> String
src/main/haskell/Hydra/Print/Emacs/Regex.hs view
@@ -40,6 +40,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Render an alternation, joining its branches with Emacs's \| operator. alternation :: [[Regex.Quantified]] -> String@@ -92,7 +93,7 @@                 93,                 94,                 45]-      in (Logic.ifElse isMeta (Strings.concat2 "\\" (showCodePoint c)) (showCodePoint c))+      in (Logic.ifElse isMeta (Strings.concat2 "\\" (printCodePoint c)) (printCodePoint c))  -- | Render a literal code point in top-level context under Emacs regexp, escaping only the characters that are special bare in Emacs: . * + ? [ ] ^ $ \. Note | ( ) { } are literal in Emacs and are NOT escaped here. escapeLiteral :: Int -> String@@ -109,8 +110,13 @@                 94,                 36,                 92]-      in (Logic.ifElse isMeta (Strings.concat2 "\\" (showCodePoint c)) (showCodePoint c))+      in (Logic.ifElse isMeta (Strings.concat2 "\\" (printCodePoint c)) (printCodePoint c)) +-- | Render a single Unicode code point as a one-character string.+printCodePoint :: Int -> String+printCodePoint c = Strings.fromList [+  c]+ -- | Render a hydra.regex AST into GNU Emacs regexp syntax (escaped \| \( \) \{..\}, . as [^z-a]). printRegex :: [[Regex.Quantified]] -> String printRegex r = alternation r@@ -129,24 +135,19 @@       Regex.QuantifierOneOrMore -> "+"       Regex.QuantifierExactly v0 -> Strings.concat [         "\\{",-        (Literals.showInt32 v0),+        (Literals.printInt32 v0),         "\\}"]       Regex.QuantifierAtLeast v0 -> Strings.concat [         "\\{",-        (Literals.showInt32 v0),+        (Literals.printInt32 v0),         ",\\}"]       Regex.QuantifierRange_ v0 -> Strings.concat [         "\\{",-        (Literals.showInt32 (Regex.quantifierRangeMin v0)),+        (Literals.printInt32 (Regex.quantifierRangeMin v0)),         ",",-        (Literals.showInt32 (Regex.quantifierRangeMax v0)),+        (Literals.printInt32 (Regex.quantifierRangeMax v0)),         "\\}"]  -- | Render a sequence of quantified atoms by concatenation. regexSequence :: [Regex.Quantified] -> String regexSequence s = Strings.concat (Lists.map quantified s)---- | Render a single Unicode code point as a one-character string.-showCodePoint :: Int -> String-showCodePoint c = Strings.fromList [-  c]
src/main/haskell/Hydra/Print/Error/Core.hs view
@@ -40,6 +40,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Show a constant condition error as a string constantConditionError :: ErrorCore.ConstantConditionError -> String
src/main/haskell/Hydra/Print/Error/Packaging.hs view
@@ -37,6 +37,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Show a conflicting module namespace error as a string conflictingModuleNameError :: ErrorPackaging.ConflictingModuleNameError -> String
src/main/haskell/Hydra/Print/Errors.hs view
@@ -44,6 +44,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Show a checking error as a string checkingError :: Checking.CheckingError -> String@@ -100,7 +101,7 @@         "not a forall type: ",         (PrintCore.type_ typ),         ". Trying to apply ",-        (Literals.showInt32 (Lists.length args)),+        (Literals.printInt32 (Lists.length args)),         " type argument(s): ",         (Formatting.showList PrintCore.type_ args)]) @@ -141,9 +142,9 @@         "type ",         (PrintCore.type_ typ),         " applied to the wrong number of type arguments (expected ",-        (Literals.showInt32 expected),+        (Literals.printInt32 expected),         ", got ",-        (Literals.showInt32 actual),+        (Literals.printInt32 actual),         "): ",         (Formatting.showList PrintCore.type_ args)]) 
src/main/haskell/Hydra/Print/Graph.hs view
@@ -38,6 +38,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Show a list of bindings as a string graph :: [Core.Binding] -> String
src/main/haskell/Hydra/Print/Paths.hs view
@@ -1,6 +1,6 @@ -- Note: this is an automatically generated file. Do not edit. --- | Utilities for working with subterm steps and paths.+-- | Serialization (printing and parsing) of subterm and subtype steps and paths.  module Hydra.Print.Paths where @@ -17,11 +17,11 @@ import qualified Hydra.File as File import qualified Hydra.Graph as Graph import qualified Hydra.Json.Model as Model+import qualified Hydra.Overlay.Haskell.Lib.Equality as Equality import qualified Hydra.Overlay.Haskell.Lib.Lists as Lists-import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Overlay.Haskell.Lib.Literals as Literals+import qualified Hydra.Overlay.Haskell.Lib.Logic as Logic import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals-import qualified Hydra.Overlay.Haskell.Lib.Pairs as Pairs-import qualified Hydra.Overlay.Haskell.Lib.Sets as Sets import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings import qualified Hydra.Names as Names import qualified Hydra.Packaging as Packaging@@ -30,7 +30,6 @@ import qualified Hydra.Query as Query import qualified Hydra.Regex as Regex import qualified Hydra.Relational as Relational-import qualified Hydra.Rewriting as Rewriting import qualified Hydra.System as System import qualified Hydra.Tabular as Tabular import qualified Hydra.Testing as Testing@@ -43,99 +42,97 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci-import qualified Data.Map as M+import Data.Void --- | Convert a subterm step to a string representation-subtermStep :: Paths.SubtermStep -> Maybe String-subtermStep step =+-- | Parse a printed subterm path (steps joined by '/') back into a SubtermPath+parseSubtermPath :: String -> Maybe Paths.SubtermPath+parseSubtermPath s =+    Optionals.map (\x -> Paths.SubtermPath x) (Lists.foldl (\macc -> \tok -> Optionals.bind macc (\acc -> Optionals.map (\st -> Lists.concat2 acc [+      st]) (parseSubtermStep tok))) (Just []) (Strings.splitOn "/" s)) -      let idx = \i -> Nothing-          idxSuff = \suffix -> \i -> Optionals.map (\s -> Strings.concat2 s suffix) (idx i)-      in case step of-        Paths.SubtermStepAnnotatedBody -> Nothing-        Paths.SubtermStepApplicationFunction -> Just "fun"-        Paths.SubtermStepApplicationArgument -> Just "arg"-        Paths.SubtermStepLambdaBody -> Just "body"-        Paths.SubtermStepUnionCasesDefault -> Just "default"-        Paths.SubtermStepUnionCasesBranch v0 -> Just (Strings.concat2 "." (Core.unName v0))-        Paths.SubtermStepLetBody -> Just "in"-        Paths.SubtermStepLetBinding v0 -> Just (Strings.concat2 (Core.unName v0) "=")-        Paths.SubtermStepListElement v0 -> idx v0-        Paths.SubtermStepMapKey v0 -> idxSuff ".key" v0-        Paths.SubtermStepMapValue v0 -> idxSuff ".value" v0-        Paths.SubtermStepOptionalTerm -> Just "given"-        Paths.SubtermStepProductTerm v0 -> idx v0-        Paths.SubtermStepRecordField v0 -> Just (Strings.concat2 "." (Core.unName v0))-        Paths.SubtermStepSetElement v0 -> idx v0-        Paths.SubtermStepSumTerm -> Nothing-        Paths.SubtermStepTypeLambdaBody -> Nothing-        Paths.SubtermStepTypeApplicationTerm -> Nothing-        Paths.SubtermStepInjectionTerm -> Nothing-        Paths.SubtermStepWrappedTerm -> Nothing+-- | Parse a printed subterm step token back into a SubtermStep+parseSubtermStep :: String -> Maybe Paths.SubtermStep+parseSubtermStep tok = --- | Build a subterm graph from a term-termToSubtermGraph :: M.Map Packaging.ModuleName String -> Core.Term -> Paths.SubtermGraph-termToSubtermGraph namespaces term =+      let segs = Strings.splitOn ":" tok+          tag = Optionals.withDefault tok (Lists.at 0 segs)+          mpayload = Lists.at 1 segs+          name = Optionals.map (\x -> Core.Name x) mpayload+          idx = Optionals.bind mpayload Literals.parseInt32+      in (Logic.ifElse (Equality.equal tag "annotatedAnnotation") (Just Paths.SubtermStepAnnotatedAnnotation) (Logic.ifElse (Equality.equal tag "annotatedBody") (Just Paths.SubtermStepAnnotatedBody) (Logic.ifElse (Equality.equal tag "applicationArgument") (Just Paths.SubtermStepApplicationArgument) (Logic.ifElse (Equality.equal tag "applicationFunction") (Just Paths.SubtermStepApplicationFunction) (Logic.ifElse (Equality.equal tag "casesCase") (Optionals.map (\x -> Paths.SubtermStepCasesCase x) name) (Logic.ifElse (Equality.equal tag "casesDefault") (Just Paths.SubtermStepCasesDefault) (Logic.ifElse (Equality.equal tag "eitherLeft") (Just Paths.SubtermStepEitherLeft) (Logic.ifElse (Equality.equal tag "eitherRight") (Just Paths.SubtermStepEitherRight) (Logic.ifElse (Equality.equal tag "injectField") (Optionals.map (\x -> Paths.SubtermStepInjectField x) name) (Logic.ifElse (Equality.equal tag "lambdaBody") (Just Paths.SubtermStepLambdaBody) (Logic.ifElse (Equality.equal tag "letBinding") (Optionals.map (\x -> Paths.SubtermStepLetBinding x) name) (Logic.ifElse (Equality.equal tag "letBody") (Just Paths.SubtermStepLetBody) (Logic.ifElse (Equality.equal tag "listElement") (Optionals.map (\x -> Paths.SubtermStepListElement x) idx) (Logic.ifElse (Equality.equal tag "mapKey") (Optionals.map (\x -> Paths.SubtermStepMapKey x) idx) (Logic.ifElse (Equality.equal tag "mapValue") (Optionals.map (\x -> Paths.SubtermStepMapValue x) idx) (Logic.ifElse (Equality.equal tag "optionalGiven") (Just Paths.SubtermStepOptionalGiven) (Logic.ifElse (Equality.equal tag "pairFirst") (Just Paths.SubtermStepPairFirst) (Logic.ifElse (Equality.equal tag "pairSecond") (Just Paths.SubtermStepPairSecond) (Logic.ifElse (Equality.equal tag "recordField") (Optionals.map (\x -> Paths.SubtermStepRecordField x) name) (Logic.ifElse (Equality.equal tag "setElement") (Optionals.map (\x -> Paths.SubtermStepSetElement x) idx) (Logic.ifElse (Equality.equal tag "typeApplicationBody") (Just Paths.SubtermStepTypeApplicationBody) (Logic.ifElse (Equality.equal tag "typeLambdaBody") (Just Paths.SubtermStepTypeLambdaBody) (Logic.ifElse (Equality.equal tag "wrapBody") (Just Paths.SubtermStepWrapBody) Nothing))))))))))))))))))))))) -      let dontCareStep = Paths.SubtermStepAnnotatedBody-          helper =-                  \ids -> \mroot -> \path -> \state -> \stepTerm ->-                    let step = Pairs.first stepTerm-                        currentTerm = Pairs.second stepTerm-                        nodesEdges = Pairs.first state-                        visited = Pairs.second state-                        nodes = Pairs.first nodesEdges-                        edges = Pairs.second nodesEdges-                        nextPath = Lists.cons step path-                    in case currentTerm of-                      Core.TermLet v0 ->-                        let bindings = Core.letBindings v0-                            env = Core.letBody v0-                            bindingNames = Lists.map Core.bindingName bindings-                            addBindingName =-                                    \nodesVisitedIds -> \name ->-                                      let currentNodesVisited = Pairs.first nodesVisitedIds-                                          currentIds = Pairs.second nodesVisitedIds-                                          currentNodes = Pairs.first currentNodesVisited-                                          currentVisited = Pairs.second currentNodesVisited-                                          rawLabel = Names.compactName namespaces name-                                          uniqueLabel = Names.chooseUniqueLabel currentVisited rawLabel-                                          node =-                                                  Paths.SubtermNode {-                                                    Paths.subtermNodeName = name,-                                                    Paths.subtermNodeLabel = rawLabel,-                                                    Paths.subtermNodeId = uniqueLabel}-                                          newVisited = Sets.insert uniqueLabel currentVisited-                                          newNodes = Lists.cons node currentNodes-                                          newIds = Maps.insert name node currentIds-                                      in ((newNodes, newVisited), newIds)-                            nodesVisitedIds1 = Lists.foldl addBindingName (([], visited), ids) bindingNames-                            nodes1 = Pairs.first (Pairs.first nodesVisitedIds1)-                            visited1 = Pairs.second (Pairs.first nodesVisitedIds1)-                            ids1 = Pairs.second nodesVisitedIds1-                            addBindingTerm =-                                    \currentState -> \nodeBinding ->-                                      let root = Pairs.first nodeBinding-                                          binding = Pairs.second nodeBinding-                                          term1 = Core.bindingTerm binding-                                      in (helper ids1 (Just root) [] currentState (dontCareStep, term1))-                            nodeBindingPairs = Lists.zip nodes1 bindings-                            stateAfterBindings = Lists.foldl addBindingTerm ((Lists.concat2 nodes1 nodes, edges), visited1) nodeBindingPairs-                        in (helper ids1 mroot nextPath stateAfterBindings (Paths.SubtermStepLetBody, env))-                      Core.TermVariable v0 -> Optionals.match mroot state (\root -> Optionals.match (Maps.lookup v0 ids) state (\node ->-                        let edge =-                                Paths.SubtermEdge {-                                  Paths.subtermEdgeSource = root,-                                  Paths.subtermEdgePath = (Paths.SubtermPath (Lists.reverse nextPath)),-                                  Paths.subtermEdgeTarget = node}-                            newEdges = Lists.cons edge edges-                        in ((nodes, newEdges), visited)))-                      _ -> Lists.foldl (helper ids mroot nextPath) state (Rewriting.subtermsWithSteps currentTerm)-          initialState = (([], []), Sets.empty)-          result = helper Maps.empty Nothing [] initialState (dontCareStep, term)-          finalNodesEdges = Pairs.first result-          finalNodes = Pairs.first finalNodesEdges-          finalEdges = Pairs.second finalNodesEdges-      in Paths.SubtermGraph {-        Paths.subtermGraphNodes = finalNodes,-        Paths.subtermGraphEdges = finalEdges}+-- | Parse a printed subtype path (steps joined by '/') back into a SubtypePath+parseSubtypePath :: String -> Maybe Paths.SubtypePath+parseSubtypePath s =+    Optionals.map (\x -> Paths.SubtypePath x) (Lists.foldl (\macc -> \tok -> Optionals.bind macc (\acc -> Optionals.map (\st -> Lists.concat2 acc [+      st]) (parseSubtypeStep tok))) (Just []) (Strings.splitOn "/" s))++-- | Parse a printed subtype step token back into a SubtypeStep+parseSubtypeStep :: String -> Maybe Paths.SubtypeStep+parseSubtypeStep tok =++      let segs = Strings.splitOn ":" tok+          tag = Optionals.withDefault tok (Lists.at 0 segs)+          mpayload = Lists.at 1 segs+          name = Optionals.map (\x -> Core.Name x) mpayload+      in (Logic.ifElse (Equality.equal tag "annotatedBody") (Just Paths.SubtypeStepAnnotatedBody) (Logic.ifElse (Equality.equal tag "applicationArgument") (Just Paths.SubtypeStepApplicationArgument) (Logic.ifElse (Equality.equal tag "applicationFunction") (Just Paths.SubtypeStepApplicationFunction) (Logic.ifElse (Equality.equal tag "effectValue") (Just Paths.SubtypeStepEffectValue) (Logic.ifElse (Equality.equal tag "eitherLeft") (Just Paths.SubtypeStepEitherLeft) (Logic.ifElse (Equality.equal tag "eitherRight") (Just Paths.SubtypeStepEitherRight) (Logic.ifElse (Equality.equal tag "forallBody") (Just Paths.SubtypeStepForallBody) (Logic.ifElse (Equality.equal tag "functionCodomain") (Just Paths.SubtypeStepFunctionCodomain) (Logic.ifElse (Equality.equal tag "functionDomain") (Just Paths.SubtypeStepFunctionDomain) (Logic.ifElse (Equality.equal tag "listElement") (Just Paths.SubtypeStepListElement) (Logic.ifElse (Equality.equal tag "mapKeys") (Just Paths.SubtypeStepMapKeys) (Logic.ifElse (Equality.equal tag "mapValues") (Just Paths.SubtypeStepMapValues) (Logic.ifElse (Equality.equal tag "optionalElement") (Just Paths.SubtypeStepOptionalElement) (Logic.ifElse (Equality.equal tag "pairFirst") (Just Paths.SubtypeStepPairFirst) (Logic.ifElse (Equality.equal tag "pairSecond") (Just Paths.SubtypeStepPairSecond) (Logic.ifElse (Equality.equal tag "recordField") (Optionals.map (\x -> Paths.SubtypeStepRecordField x) name) (Logic.ifElse (Equality.equal tag "setElement") (Just Paths.SubtypeStepSetElement) (Logic.ifElse (Equality.equal tag "unionField") (Optionals.map (\x -> Paths.SubtypeStepUnionField x) name) (Logic.ifElse (Equality.equal tag "wrapBody") (Just Paths.SubtypeStepWrapBody) Nothing)))))))))))))))))))++-- | Print a subterm path as its steps joined by '/'+subtermPath :: Paths.SubtermPath -> String+subtermPath path = Strings.join "/" (Lists.map subtermStep (Paths.unSubtermPath path))++-- | Print a subterm step in its round-trippable notation+subtermStep :: Paths.SubtermStep -> String+subtermStep step =+    case step of+      Paths.SubtermStepAnnotatedAnnotation -> "annotatedAnnotation"+      Paths.SubtermStepAnnotatedBody -> "annotatedBody"+      Paths.SubtermStepApplicationArgument -> "applicationArgument"+      Paths.SubtermStepApplicationFunction -> "applicationFunction"+      Paths.SubtermStepCasesCase v0 -> Strings.concat2 "casesCase:" (Core.unName v0)+      Paths.SubtermStepCasesDefault -> "casesDefault"+      Paths.SubtermStepEitherLeft -> "eitherLeft"+      Paths.SubtermStepEitherRight -> "eitherRight"+      Paths.SubtermStepInjectField v0 -> Strings.concat2 "injectField:" (Core.unName v0)+      Paths.SubtermStepLambdaBody -> "lambdaBody"+      Paths.SubtermStepLetBinding v0 -> Strings.concat2 "letBinding:" (Core.unName v0)+      Paths.SubtermStepLetBody -> "letBody"+      Paths.SubtermStepListElement v0 -> Strings.concat2 "listElement:" (Literals.printInt32 v0)+      Paths.SubtermStepMapKey v0 -> Strings.concat2 "mapKey:" (Literals.printInt32 v0)+      Paths.SubtermStepMapValue v0 -> Strings.concat2 "mapValue:" (Literals.printInt32 v0)+      Paths.SubtermStepOptionalGiven -> "optionalGiven"+      Paths.SubtermStepPairFirst -> "pairFirst"+      Paths.SubtermStepPairSecond -> "pairSecond"+      Paths.SubtermStepRecordField v0 -> Strings.concat2 "recordField:" (Core.unName v0)+      Paths.SubtermStepSetElement v0 -> Strings.concat2 "setElement:" (Literals.printInt32 v0)+      Paths.SubtermStepTypeApplicationBody -> "typeApplicationBody"+      Paths.SubtermStepTypeLambdaBody -> "typeLambdaBody"+      Paths.SubtermStepWrapBody -> "wrapBody"++-- | Print a subtype path as its steps joined by '/'+subtypePath :: Paths.SubtypePath -> String+subtypePath path = Strings.join "/" (Lists.map subtypeStep (Paths.unSubtypePath path))++-- | Print a subtype step in its round-trippable notation+subtypeStep :: Paths.SubtypeStep -> String+subtypeStep step =+    case step of+      Paths.SubtypeStepAnnotatedBody -> "annotatedBody"+      Paths.SubtypeStepApplicationArgument -> "applicationArgument"+      Paths.SubtypeStepApplicationFunction -> "applicationFunction"+      Paths.SubtypeStepEffectValue -> "effectValue"+      Paths.SubtypeStepEitherLeft -> "eitherLeft"+      Paths.SubtypeStepEitherRight -> "eitherRight"+      Paths.SubtypeStepForallBody -> "forallBody"+      Paths.SubtypeStepFunctionCodomain -> "functionCodomain"+      Paths.SubtypeStepFunctionDomain -> "functionDomain"+      Paths.SubtypeStepListElement -> "listElement"+      Paths.SubtypeStepMapKeys -> "mapKeys"+      Paths.SubtypeStepMapValues -> "mapValues"+      Paths.SubtypeStepOptionalElement -> "optionalElement"+      Paths.SubtypeStepPairFirst -> "pairFirst"+      Paths.SubtypeStepPairSecond -> "pairSecond"+      Paths.SubtypeStepRecordField v0 -> Strings.concat2 "recordField:" (Core.unName v0)+      Paths.SubtypeStepSetElement -> "setElement"+      Paths.SubtypeStepUnionField v0 -> Strings.concat2 "unionField:" (Core.unName v0)+      Paths.SubtypeStepWrapBody -> "wrapBody"
src/main/haskell/Hydra/Print/Pcre/Regex.hs view
@@ -40,6 +40,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Render an alternation, joining its branches with the | operator. alternation :: [[Regex.Quantified]] -> String@@ -88,7 +89,7 @@                 93,                 94,                 45]-      in (Logic.ifElse isMeta (Strings.concat2 "\\" (showCodePoint c)) (showCodePoint c))+      in (Logic.ifElse isMeta (Strings.concat2 "\\" (printCodePoint c)) (printCodePoint c))  -- | Render a literal code point in top-level context, backslash-escaping PCRE/ECMA metacharacters. escapeLiteral :: Int -> String@@ -110,8 +111,13 @@                 125,                 124,                 92]-      in (Logic.ifElse isMeta (Strings.concat2 "\\" (showCodePoint c)) (showCodePoint c))+      in (Logic.ifElse isMeta (Strings.concat2 "\\" (printCodePoint c)) (printCodePoint c)) +-- | Render a single Unicode code point as a one-character string.+printCodePoint :: Int -> String+printCodePoint c = Strings.fromList [+  c]+ -- | Render a hydra.regex AST into PCRE / java.util.regex / ECMA syntax. Identical to the canonical printer except that . (any incl. newline) becomes [\s\S]. printRegex :: [[Regex.Quantified]] -> String printRegex r = alternation r@@ -130,24 +136,19 @@       Regex.QuantifierOneOrMore -> "+"       Regex.QuantifierExactly v0 -> Strings.concat [         "{",-        (Literals.showInt32 v0),+        (Literals.printInt32 v0),         "}"]       Regex.QuantifierAtLeast v0 -> Strings.concat [         "{",-        (Literals.showInt32 v0),+        (Literals.printInt32 v0),         ",}"]       Regex.QuantifierRange_ v0 -> Strings.concat [         "{",-        (Literals.showInt32 (Regex.quantifierRangeMin v0)),+        (Literals.printInt32 (Regex.quantifierRangeMin v0)),         ",",-        (Literals.showInt32 (Regex.quantifierRangeMax v0)),+        (Literals.printInt32 (Regex.quantifierRangeMax v0)),         "}"]  -- | Render a sequence of quantified atoms by concatenation. regexSequence :: [Regex.Quantified] -> String regexSequence s = Strings.concat (Lists.map quantified s)---- | Render a single Unicode code point as a one-character string.-showCodePoint :: Int -> String-showCodePoint c = Strings.fromList [-  c]
src/main/haskell/Hydra/Print/Posix/Regex.hs view
@@ -40,6 +40,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Render an alternation, joining its branches with the | operator. alternation :: [[Regex.Quantified]] -> String@@ -50,9 +51,9 @@ anyClass =     Strings.concat [       "[",-      (showCodePoint 0),+      (printCodePoint 0),       "-",-      (showCodePoint 1114111),+      (printCodePoint 1114111),       "]"]  -- | Render a single atom; . renders as the explicit full-code-point-range class (POSIX-safe).@@ -98,7 +99,7 @@                 93,                 94,                 45]-      in (Logic.ifElse isMeta (Strings.concat2 "\\" (showCodePoint c)) (showCodePoint c))+      in (Logic.ifElse isMeta (Strings.concat2 "\\" (printCodePoint c)) (printCodePoint c))  -- | Render a literal code point in top-level context, backslash-escaping POSIX ERE metacharacters. escapeLiteral :: Int -> String@@ -120,8 +121,13 @@                 125,                 124,                 92]-      in (Logic.ifElse isMeta (Strings.concat2 "\\" (showCodePoint c)) (showCodePoint c))+      in (Logic.ifElse isMeta (Strings.concat2 "\\" (printCodePoint c)) (printCodePoint c)) +-- | Render a single Unicode code point as a one-character string.+printCodePoint :: Int -> String+printCodePoint c = Strings.fromList [+  c]+ -- | Render a hydra.regex AST into POSIX ERE syntax. Identical to the canonical printer except that . (any incl. newline) becomes the explicit full-code-point-range class. printRegex :: [[Regex.Quantified]] -> String printRegex r = alternation r@@ -140,24 +146,19 @@       Regex.QuantifierOneOrMore -> "+"       Regex.QuantifierExactly v0 -> Strings.concat [         "{",-        (Literals.showInt32 v0),+        (Literals.printInt32 v0),         "}"]       Regex.QuantifierAtLeast v0 -> Strings.concat [         "{",-        (Literals.showInt32 v0),+        (Literals.printInt32 v0),         ",}"]       Regex.QuantifierRange_ v0 -> Strings.concat [         "{",-        (Literals.showInt32 (Regex.quantifierRangeMin v0)),+        (Literals.printInt32 (Regex.quantifierRangeMin v0)),         ",",-        (Literals.showInt32 (Regex.quantifierRangeMax v0)),+        (Literals.printInt32 (Regex.quantifierRangeMax v0)),         "}"]  -- | Render a sequence of quantified atoms by concatenation. regexSequence :: [Regex.Quantified] -> String regexSequence s = Strings.concat (Lists.map quantified s)---- | Render a single Unicode code point as a one-character string.-showCodePoint :: Int -> String-showCodePoint c = Strings.fromList [-  c]
src/main/haskell/Hydra/Print/Regex.hs view
@@ -40,6 +40,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Render an alternation, joining its branches with the | operator. alternation :: [[Regex.Quantified]] -> String@@ -88,7 +89,7 @@                 93,                 94,                 45]-      in (Logic.ifElse isMeta (Strings.concat2 "\\" (showCodePoint c)) (showCodePoint c))+      in (Logic.ifElse isMeta (Strings.concat2 "\\" (printCodePoint c)) (printCodePoint c))  -- | Render a literal code point in top-level context, backslash-escaping it iff it is one of the top-level metacharacters . ^ $ * + ? ( ) [ ] { } | \. A '-' is not special at top level and prints bare. escapeLiteral :: Int -> String@@ -110,8 +111,13 @@                 125,                 124,                 92]-      in (Logic.ifElse isMeta (Strings.concat2 "\\" (showCodePoint c)) (showCodePoint c))+      in (Logic.ifElse isMeta (Strings.concat2 "\\" (printCodePoint c)) (printCodePoint c)) +-- | Render a single Unicode code point as a one-character string.+printCodePoint :: Int -> String+printCodePoint c = Strings.fromList [+  c]+ -- | Render a hydra.regex AST to canonical Hydra regex text. Escapes minimally, so that printRegex . parseRegex is the identity on well-formed patterns. printRegex :: [[Regex.Quantified]] -> String printRegex r = alternation r@@ -130,24 +136,19 @@       Regex.QuantifierOneOrMore -> "+"       Regex.QuantifierExactly v0 -> Strings.concat [         "{",-        (Literals.showInt32 v0),+        (Literals.printInt32 v0),         "}"]       Regex.QuantifierAtLeast v0 -> Strings.concat [         "{",-        (Literals.showInt32 v0),+        (Literals.printInt32 v0),         ",}"]       Regex.QuantifierRange_ v0 -> Strings.concat [         "{",-        (Literals.showInt32 (Regex.quantifierRangeMin v0)),+        (Literals.printInt32 (Regex.quantifierRangeMin v0)),         ",",-        (Literals.showInt32 (Regex.quantifierRangeMax v0)),+        (Literals.printInt32 (Regex.quantifierRangeMax v0)),         "}"]  -- | Render a sequence of quantified atoms by concatenation. regexSequence :: [Regex.Quantified] -> String regexSequence s = Strings.concat (Lists.map quantified s)---- | Render a single Unicode code point as a one-character string.-showCodePoint :: Int -> String-showCodePoint c = Strings.fromList [-  c]
src/main/haskell/Hydra/Print/Typing.hs view
@@ -40,6 +40,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Show a type constraint as a string typeConstraint :: Typing.TypeConstraint -> String
src/main/haskell/Hydra/Print/Util.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Show a case convention as a string caseConvention :: Util.CaseConvention -> String
src/main/haskell/Hydra/Print/Variants.hs view
@@ -35,6 +35,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Show a term variant as a string termVariant :: Variants.TermVariant -> String
src/main/haskell/Hydra/Query.hs view
@@ -7,6 +7,7 @@ import qualified Hydra.Core as Core import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | One of several comparison operators data ComparisonConstraint =
src/main/haskell/Hydra/Reduction.hs view
@@ -62,6 +62,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Alpha convert a variable in a term alphaConvert :: Core.Name -> Core.Name -> Core.Term -> Core.Term@@ -172,7 +173,7 @@                           codomainType = peelFunctionDomains remainingType needed                           fullyAppliedRaw =                                   Lists.foldl (\body -> \i ->-                                    let vn = Core.Name (Strings.concat2 "v" (Literals.showInt32 i))+                                    let vn = Core.Name (Strings.concat2 "v" (Literals.printInt32 i))                                     in (Core.TermApplication (Core.Application {                                       Core.applicationFunction = body,                                       Core.applicationArgument = (Core.TermVariable vn)}))) applied indices@@ -184,7 +185,7 @@                       in (Lists.foldl (\body -> \idPair ->                         let i = Pairs.first idPair                             dom = Pairs.second idPair-                            vn = Core.Name (Strings.concat2 "v" (Literals.showInt32 i))+                            vn = Core.Name (Strings.concat2 "v" (Literals.printInt32 i))                         in (Core.TermLambda (Core.Lambda {                           Core.lambdaParameter = vn,                           Core.lambdaDomain = dom,@@ -374,7 +375,7 @@                                 Core.TermVariable v0 -> Optionals.match (Optionals.map Scoping.typeSchemeToFType (Maps.lookup v0 (Graph.graphBoundTypes tx2))) (Eithers.map (\_tc -> Arity.typeArity (Pairs.first _tc)) (Checking.typeOf cx tx2 [] (Core.TermVariable v0))) (\t -> Right (Arity.typeArity t))                                 _ -> dflt                     extraVariables =-                            \n -> Lists.map (\i -> Core.Name (Strings.concat2 "v" (Literals.showInt32 i))) (Math.range 1 (Math.add n 1))+                            \n -> Lists.map (\i -> Core.Name (Strings.concat2 "v" (Literals.printInt32 i))) (Math.range 1 (Math.add n 1))                     pad =                             \vars -> \body -> Optionals.match (Lists.uncons vars) body (\uc ->                               let v0 = Pairs.first uc@@ -557,10 +558,10 @@                                     in (Eithers.bind (Eithers.bimap mapErrorToString (\x -> x) (Graph.primitiveImplementation prim graph strippedArgs)) (\primResult -> Eithers.bind (reduce eager2 primResult) (\reducedResult -> applyIfNullary eager2 reducedResult remainingArgs)))))                     in case stripped of                       Core.TermApplication v0 -> applyIfNullary eager2 (Core.applicationFunction v0) (Lists.cons (Core.applicationArgument v0) args)-                      Core.TermCases v0 -> Logic.ifElse (Lists.null args) (Right original) (forCases v0 args)-                      Core.TermProject v0 -> Logic.ifElse (Lists.null args) (Right original) (forProjection v0 args)-                      Core.TermUnwrap v0 -> Logic.ifElse (Lists.null args) (Right original) (forUnwrap v0 args)-                      Core.TermLambda v0 -> Logic.ifElse (Lists.null args) (Right original) (forLambda v0 args)+                      Core.TermCases v0 -> Logic.ifElse (Lists.isEmpty args) (Right original) (forCases v0 args)+                      Core.TermProject v0 -> Logic.ifElse (Lists.isEmpty args) (Right original) (forProjection v0 args)+                      Core.TermUnwrap v0 -> Logic.ifElse (Lists.isEmpty args) (Right original) (forUnwrap v0 args)+                      Core.TermLambda v0 -> Logic.ifElse (Lists.isEmpty args) (Right original) (forLambda v0 args)                       Core.TermVariable v0 ->                         let mBinding = Lexical.lookupBinding graph v0                         in (Optionals.match mBinding (@@ -593,7 +594,7 @@  -- | Whether a term is closed, i.e. represents a complete program termIsClosed :: Core.Term -> Bool-termIsClosed term = Sets.null (Variables.freeVariablesInTerm term)+termIsClosed term = Sets.isEmpty (Variables.freeVariablesInTerm term)  -- | Whether a term has been fully reduced to a value termIsValue :: Core.Term -> Bool
src/main/haskell/Hydra/Reflect.hs view
@@ -36,6 +36,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Find the precision of a given floating-point type floatTypePrecision :: Core.FloatType -> Util.Precision
src/main/haskell/Hydra/Refs.hs view
@@ -41,6 +41,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S 
src/main/haskell/Hydra/Regex.hs view
@@ -7,6 +7,7 @@ import qualified Hydra.Core as Core import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | A non-empty list of alternative sequences, joined by the | operator. Matches if any alternative matches. type Alternation = [RegexSequence]
src/main/haskell/Hydra/Relational.hs view
@@ -7,6 +7,7 @@ import qualified Hydra.Core as Core import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S 
src/main/haskell/Hydra/Resolution.hs view
@@ -53,6 +53,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | Dereference a type name to get the actual type (Either version)@@ -60,7 +61,7 @@ dereferenceType cx graph name =        let mel = Lexical.lookupBinding graph name-      in (Optionals.match mel (Right Nothing) (\el -> Eithers.map Optionals.pure (Eithers.bimap (\_e -> Errors.ErrorResolution (Errors.ResolutionErrorUnexpectedShape (Errors.UnexpectedShapeError {+      in (Optionals.match mel (Right Nothing) (\el -> Eithers.map Optionals.given (Eithers.bimap (\_e -> Errors.ErrorResolution (Errors.ResolutionErrorUnexpectedShape (Errors.UnexpectedShapeError {         Errors.unexpectedShapeErrorExpected = "type",         Errors.unexpectedShapeErrorActual = (Errors.unDecodingError _e)}))) (\_a -> _a) (DecodeCore.type_ graph (Core.bindingTerm el))))) @@ -110,7 +111,7 @@           noMatch =                   Left (Errors.ErrorResolution (Errors.ResolutionErrorNoMatchingField (Errors.NoMatchingFieldError {                     Errors.noMatchingFieldErrorFieldName = fname})))-      in (Logic.ifElse (Lists.null matchingFields) noMatch (Logic.ifElse (Equality.equal (Lists.length matchingFields) 1) (Optionals.match (Lists.head matchingFields) noMatch (\ft -> Right (Core.fieldTypeType ft))) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorMultipleFields (Errors.MultipleFieldsError {+      in (Logic.ifElse (Lists.isEmpty matchingFields) noMatch (Logic.ifElse (Equality.equal (Lists.length matchingFields) 1) (Optionals.match (Lists.head matchingFields) noMatch (\ft -> Right (Core.fieldTypeType ft))) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorMultipleFields (Errors.MultipleFieldsError {         Errors.multipleFieldsErrorFieldName = fname}))))))  -- | Fully strip a type of forall quantifiers, normalizing bound variable names for alpha-equivalence comparison@@ -121,7 +122,7 @@               \depth -> \subst -> \t -> case (Strip.deannotateType t) of                 Core.TypeForall v0 ->                   let oldVar = Core.forallTypeParameter v0-                      newVar = Core.Name (Strings.concat2 "_" (Literals.showInt32 depth))+                      newVar = Core.Name (Strings.concat2 "_" (Literals.printInt32 depth))                   in (go (Math.add depth 1) (Maps.insert oldVar newVar subst) (Core.forallTypeBody v0))                 _ -> (subst, t)           result = go 0 Maps.empty typ@@ -154,7 +155,7 @@           subst = Typing.TypeSubst (Maps.fromList (Lists.zip oldVars (Lists.map (\x -> Core.TypeVariable x) newVars)))           nameSubst = Maps.fromList (Lists.zip oldVars newVars)           renamedConstraints =-                  Optionals.map (\oldConstraints -> Maps.fromList (Lists.map (\kv -> (Optionals.withDefault (Pairs.first kv) (Maps.lookup (Pairs.first kv) nameSubst), (Pairs.second kv))) (Maps.toList oldConstraints))) (Core.typeSchemeConstraints scheme)+                  Maps.fromList (Lists.map (\kv -> (Optionals.withDefault (Pairs.first kv) (Maps.lookup (Pairs.first kv) nameSubst), (Pairs.second kv))) (Maps.toList (Core.typeSchemeConstraints scheme)))       in (         Core.TypeScheme {           Core.typeSchemeVariables = newVars,@@ -262,5 +263,5 @@                 _ -> Core.TypeScheme {                   Core.typeSchemeVariables = (Lists.reverse vars),                   Core.typeSchemeBody = t,-                  Core.typeSchemeConstraints = Nothing}+                  Core.typeSchemeConstraints = Maps.empty}       in (helper [] t0)
src/main/haskell/Hydra/Rewriting.hs view
@@ -44,6 +44,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Apply a term-level function inside any leading type lambdas applyInsideTypeLambdasAndAnnotations :: (Core.Term -> Core.Term) -> Core.Term -> Core.Term@@ -326,10 +327,10 @@                   Core.TermCases v0 ->                     let rmd =                             Optionals.map (\def -> recurse (Lists.concat2 path [-                              Paths.SubtermStepUnionCasesDefault]) val0 def) (Core.caseStatementDefault v0)+                              Paths.SubtermStepCasesDefault]) val0 def) (Core.caseStatementDefault v0)                         val1 = Optionals.match rmd val0 Pairs.first                         rcases =-                                forManyWithAccessors recurse (\x -> x) val1 (Lists.map (\f2 -> (Paths.SubtermStepUnionCasesBranch (Core.caseAlternativeName f2), (Core.caseAlternativeHandler f2))) (Core.caseStatementCases v0))+                                forManyWithAccessors recurse (\x -> x) val1 (Lists.map (\f2 -> (Paths.SubtermStepCasesCase (Core.caseAlternativeName f2), (Core.caseAlternativeHandler f2))) (Core.caseStatementCases v0))                     in (                       Pairs.first rcases,                       (Core.TermCases (Core.CaseStatement {@@ -340,10 +341,10 @@                           Core.caseAlternativeHandler = (Pairs.second ft)}) (Lists.zip (Lists.map Core.caseAlternativeName (Core.caseStatementCases v0)) (Pairs.second rcases)))})))                   Core.TermEither v0 -> Eithers.either (\l ->                     let rl = recurse (Lists.concat2 path [-                          Paths.SubtermStepSumTerm]) val0 l+                          Paths.SubtermStepEitherLeft]) val0 l                     in (Pairs.first rl, (Core.TermEither (Left (Pairs.second rl))))) (\r ->                     let rr = recurse (Lists.concat2 path [-                          Paths.SubtermStepSumTerm]) val0 r+                          Paths.SubtermStepEitherRight]) val0 r                     in (Pairs.first rr, (Core.TermEither (Right (Pairs.second rr))))) v0                   Core.TermLambda v0 ->                     let rl = recurse (Lists.concat2 path [@@ -384,12 +385,12 @@                                             Paths.SubtermStepMapValue (Pairs.first r)]) (Pairs.first rk) (Pairs.second kv)                                   in (Math.add (Pairs.first r) 1, (Pairs.first rv, (Lists.cons (Pairs.second rk, (Pairs.second rv)) (Pairs.second (Pairs.second r)))))) (idx, (val0, [])) (Maps.toList v0)                     in (Pairs.first (Pairs.second rr), (Core.TermMap (Maps.fromList (Lists.reverse (Pairs.second (Pairs.second rr))))))-                  Core.TermOptional v0 -> Optionals.match v0 dflt (\t -> forSingleWithAccessor recurse (\t1 -> Core.TermOptional (Just t1)) Paths.SubtermStepOptionalTerm val0 t)+                  Core.TermOptional v0 -> Optionals.match v0 dflt (\t -> forSingleWithAccessor recurse (\t1 -> Core.TermOptional (Just t1)) Paths.SubtermStepOptionalGiven val0 t)                   Core.TermPair v0 ->                     let rf = recurse (Lists.concat2 path [-                          Paths.SubtermStepProductTerm 0]) val0 (Pairs.first v0)+                          Paths.SubtermStepPairFirst]) val0 (Pairs.first v0)                         rs = recurse (Lists.concat2 path [-                              Paths.SubtermStepProductTerm 1]) (Pairs.first rf) (Pairs.second v0)+                              Paths.SubtermStepPairSecond]) (Pairs.first rf) (Pairs.second v0)                     in (Pairs.first rs, (Core.TermPair (Pairs.second rf, (Pairs.second rs))))                   Core.TermProject v0 -> (val0, (Core.TermProject v0))                   Core.TermRecord v0 ->@@ -412,7 +413,7 @@                     in (Pairs.first (Pairs.second rr), (Core.TermSet (Sets.fromList (Lists.reverse (Pairs.second (Pairs.second rr))))))                   Core.TermTypeApplication v0 -> forSingleWithAccessor recurse (\t -> Core.TermTypeApplication (Core.TypeApplicationTerm {                     Core.typeApplicationTermBody = t,-                    Core.typeApplicationTermType = (Core.typeApplicationTermType v0)})) Paths.SubtermStepTypeApplicationTerm val0 (Core.typeApplicationTermBody v0)+                    Core.typeApplicationTermType = (Core.typeApplicationTermType v0)})) Paths.SubtermStepTypeApplicationBody val0 (Core.typeApplicationTermBody v0)                   Core.TermTypeLambda v0 -> forSingleWithAccessor recurse (\t -> Core.TermTypeLambda (Core.TypeLambda {                     Core.typeLambdaParameter = (Core.typeLambdaParameter v0),                     Core.typeLambdaBody = t})) Paths.SubtermStepTypeLambdaBody val0 (Core.typeLambdaBody v0)@@ -420,11 +421,11 @@                     Core.injectionTypeName = (Core.injectionTypeName v0),                     Core.injectionField = Core.Field {                       Core.fieldName = (Core.fieldName (Core.injectionField v0)),-                      Core.fieldTerm = t}})) Paths.SubtermStepInjectionTerm val0 (Core.fieldTerm (Core.injectionField v0))+                      Core.fieldTerm = t}})) (Paths.SubtermStepInjectField (Core.fieldName (Core.injectionField v0))) val0 (Core.fieldTerm (Core.injectionField v0))                   Core.TermUnwrap v0 -> (val0, (Core.TermUnwrap v0))                   Core.TermWrap v0 -> forSingleWithAccessor recurse (\t -> Core.TermWrap (Core.WrappedTerm {                     Core.wrappedTermTypeName = (Core.wrappedTermTypeName v0),-                    Core.wrappedTermBody = t})) Paths.SubtermStepWrappedTerm val0 (Core.wrappedTermBody v0)+                    Core.wrappedTermBody = t})) Paths.SubtermStepWrapBody val0 (Core.wrappedTermBody v0)                   _ -> dflt           recurse = f (fsub recurse)       in (recurse [] term0)@@ -534,7 +535,7 @@                     let n = Core.caseStatementTypeName v0                         def = Core.caseStatementDefault v0                         csCases = Core.caseStatementCases v0-                    in (Eithers.bind (Optionals.match def (Right Nothing) (\t -> Eithers.map Optionals.pure (recurse t))) (\rdef -> Eithers.map (\rcases -> Core.TermCases (Core.CaseStatement {+                    in (Eithers.bind (Optionals.match def (Right Nothing) (\t -> Eithers.map Optionals.given (recurse t))) (\rdef -> Eithers.map (\rcases -> Core.TermCases (Core.CaseStatement {                       Core.caseStatementTypeName = n,                       Core.caseStatementDefault = rdef,                       Core.caseStatementCases = rcases})) (Eithers.mapList forCaseAlternative csCases)))@@ -700,7 +701,7 @@                     let n = Core.caseStatementTypeName v0                         def = Core.caseStatementDefault v0                         csCases = Core.caseStatementCases v0-                    in (Eithers.bind (Optionals.match def (Right Nothing) (\t -> Eithers.map Optionals.pure (recurse t))) (\rdef -> Eithers.map (\rcases -> Core.TermCases (Core.CaseStatement {+                    in (Eithers.bind (Optionals.match def (Right Nothing) (\t -> Eithers.map Optionals.given (recurse t))) (\rdef -> Eithers.map (\rcases -> Core.TermCases (Core.CaseStatement {                       Core.caseStatementTypeName = n,                       Core.caseStatementDefault = rdef,                       Core.caseStatementCases = rcases})) (Eithers.mapList forCaseAlternative csCases)))@@ -932,9 +933,10 @@         (Paths.SubtermStepApplicationFunction, (Core.applicationFunction v0)),         (Paths.SubtermStepApplicationArgument, (Core.applicationArgument v0))]       Core.TermCases v0 -> Lists.concat2 (Optionals.match (Core.caseStatementDefault v0) [] (\t -> [-        (Paths.SubtermStepUnionCasesDefault, t)])) (Lists.map (\f -> (Paths.SubtermStepUnionCasesBranch (Core.caseAlternativeName f), (Core.caseAlternativeHandler f))) (Core.caseStatementCases v0))-      Core.TermEither v0 -> [-        (Paths.SubtermStepSumTerm, (Eithers.either (\l -> l) (\r -> r) v0))]+        (Paths.SubtermStepCasesDefault, t)])) (Lists.map (\f -> (Paths.SubtermStepCasesCase (Core.caseAlternativeName f), (Core.caseAlternativeHandler f))) (Core.caseStatementCases v0))+      Core.TermEither v0 -> Eithers.either (\l -> [+        (Paths.SubtermStepEitherLeft, l)]) (\r -> [+        (Paths.SubtermStepEitherRight, r)]) v0       Core.TermLambda v0 -> [         (Paths.SubtermStepLambdaBody, (Core.lambdaBody v0))]       Core.TermLet v0 -> Lists.cons (Paths.SubtermStepLetBody, (Core.letBody v0)) (Lists.map (\b -> (Paths.SubtermStepLetBinding (Core.bindingName b), (Core.bindingTerm b))) (Core.letBindings v0))@@ -948,26 +950,26 @@         let idx = Pairs.first r         in (Math.add idx 1, (Lists.cons (idx, el) (Pairs.second r)))) (0, []) (Maps.toList v0)))))       Core.TermOptional v0 -> Optionals.match v0 [] (\t -> [-        (Paths.SubtermStepOptionalTerm, t)])+        (Paths.SubtermStepOptionalGiven, t)])       Core.TermPair v0 -> [-        (Paths.SubtermStepProductTerm 0, (Pairs.first v0)),-        (Paths.SubtermStepProductTerm 1, (Pairs.second v0))]+        (Paths.SubtermStepPairFirst, (Pairs.first v0)),+        (Paths.SubtermStepPairSecond, (Pairs.second v0))]       Core.TermProject _ -> []       Core.TermRecord v0 -> Lists.map (\f -> (Paths.SubtermStepRecordField (Core.fieldName f), (Core.fieldTerm f))) (Core.recordFields v0)       Core.TermSet v0 -> Lists.map (\ip -> (Paths.SubtermStepSetElement (Pairs.first ip), (Pairs.second ip))) (Lists.reverse (Pairs.second (Lists.foldl (\r -> \el ->         let idx = Pairs.first r         in (Math.add idx 1, (Lists.cons (idx, el) (Pairs.second r)))) (0, []) (Sets.toList v0))))       Core.TermTypeApplication v0 -> [-        (Paths.SubtermStepTypeApplicationTerm, (Core.typeApplicationTermBody v0))]+        (Paths.SubtermStepTypeApplicationBody, (Core.typeApplicationTermBody v0))]       Core.TermTypeLambda v0 -> [         (Paths.SubtermStepTypeLambdaBody, (Core.typeLambdaBody v0))]       Core.TermInject v0 -> [-        (Paths.SubtermStepInjectionTerm, (Core.fieldTerm (Core.injectionField v0)))]+        (Paths.SubtermStepInjectField (Core.fieldName (Core.injectionField v0)), (Core.fieldTerm (Core.injectionField v0)))]       Core.TermUnit -> []       Core.TermUnwrap _ -> []       Core.TermVariable _ -> []       Core.TermWrap v0 -> [-        (Paths.SubtermStepWrappedTerm, (Core.wrappedTermBody v0))]+        (Paths.SubtermStepWrapBody, (Core.wrappedTermBody v0))]  -- | Find the children of a given type expression subtypes :: Core.Type -> [Core.Type]@@ -1008,6 +1010,46 @@       Core.TypeVoid -> []       Core.TypeWrap v0 -> [         v0]++-- | Find the children of a given type expression, each paired with the step by which it is reached+subtypesWithSteps :: Core.Type -> [(Paths.SubtypeStep, Core.Type)]+subtypesWithSteps x =+    case x of+      Core.TypeAnnotated v0 -> [+        (Paths.SubtypeStepAnnotatedBody, (Core.annotatedTypeBody v0))]+      Core.TypeApplication v0 -> [+        (Paths.SubtypeStepApplicationFunction, (Core.applicationTypeFunction v0)),+        (Paths.SubtypeStepApplicationArgument, (Core.applicationTypeArgument v0))]+      Core.TypeEffect v0 -> [+        (Paths.SubtypeStepEffectValue, v0)]+      Core.TypeEither v0 -> [+        (Paths.SubtypeStepEitherLeft, (Core.eitherTypeLeft v0)),+        (Paths.SubtypeStepEitherRight, (Core.eitherTypeRight v0))]+      Core.TypeForall v0 -> [+        (Paths.SubtypeStepForallBody, (Core.forallTypeBody v0))]+      Core.TypeFunction v0 -> [+        (Paths.SubtypeStepFunctionDomain, (Core.functionTypeDomain v0)),+        (Paths.SubtypeStepFunctionCodomain, (Core.functionTypeCodomain v0))]+      Core.TypeList v0 -> [+        (Paths.SubtypeStepListElement, v0)]+      Core.TypeLiteral _ -> []+      Core.TypeMap v0 -> [+        (Paths.SubtypeStepMapKeys, (Core.mapTypeKeys v0)),+        (Paths.SubtypeStepMapValues, (Core.mapTypeValues v0))]+      Core.TypeOptional v0 -> [+        (Paths.SubtypeStepOptionalElement, v0)]+      Core.TypePair v0 -> [+        (Paths.SubtypeStepPairFirst, (Core.pairTypeFirst v0)),+        (Paths.SubtypeStepPairSecond, (Core.pairTypeSecond v0))]+      Core.TypeRecord v0 -> Lists.map (\f -> (Paths.SubtypeStepRecordField (Core.fieldTypeName f), (Core.fieldTypeType f))) v0+      Core.TypeSet v0 -> [+        (Paths.SubtypeStepSetElement, v0)]+      Core.TypeUnion v0 -> Lists.map (\f -> (Paths.SubtypeStepUnionField (Core.fieldTypeName f), (Core.fieldTypeType f))) v0+      Core.TypeUnit -> []+      Core.TypeVariable _ -> []+      Core.TypeVoid -> []+      Core.TypeWrap v0 -> [+        (Paths.SubtypeStepWrapBody, v0)]  -- | Convert a wrapped (newtype) term to an equivalent single-field record term, for target languages without a newtype concept wrapTermToRecord :: Core.Name -> Core.Term -> Core.Term
src/main/haskell/Hydra/Scoping.hs view
@@ -19,7 +19,6 @@ import qualified Hydra.Json.Model as Model import qualified Hydra.Overlay.Haskell.Lib.Lists as Lists import qualified Hydra.Overlay.Haskell.Lib.Literals as Literals-import qualified Hydra.Overlay.Haskell.Lib.Logic as Logic import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps import qualified Hydra.Overlay.Haskell.Lib.Math as Math import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals@@ -44,6 +43,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Extend a graph by descending into a lambda body extendGraphForLambda :: Graph.Graph -> Core.Lambda -> Graph.Graph@@ -133,7 +133,7 @@                     _ -> Core.TypeScheme {                       Core.typeSchemeVariables = (Lists.reverse vars),                       Core.typeSchemeBody = typ2,-                      Core.typeSchemeConstraints = Nothing}+                      Core.typeSchemeConstraints = Maps.empty}       in (gatherForall [] typ)  -- | Convert a TermSignature to a TypeScheme, erasing parameter names, descriptions, and laziness flags.@@ -148,13 +148,11 @@                   Lists.foldl (\acc -> \p -> Core.TypeFunction (Core.FunctionType {                     Core.functionTypeDomain = (Typing.parameterType p),                     Core.functionTypeCodomain = acc})) (Typing.resultType result) (Lists.reverse params)-          hasConstraints =-                  Lists.foldl (\acc -> \tp -> Logic.or acc (Logic.not (Lists.null (Typing.typeParameterConstraints tp)))) False typeParams           constraints =-                  Logic.ifElse hasConstraints (Just (Maps.fromList (Lists.map (\tp -> (+                  Maps.fromList (Lists.map (\tp -> (                     Typing.typeParameterName tp,                     Core.TypeVariableConstraints {-                      Core.typeVariableConstraintsClasses = (Typing.typeParameterConstraints tp)})) typeParams))) Nothing+                      Core.typeVariableConstraintsClasses = (Sets.fromList (Typing.typeParameterConstraints tp))})) typeParams)       in Core.TypeScheme {         Core.typeSchemeVariables = variables,         Core.typeSchemeBody = body,@@ -176,11 +174,11 @@        let variables = Core.typeSchemeVariables ts           body = Core.typeSchemeBody ts-          constraintsMap = Optionals.withDefault Maps.empty (Core.typeSchemeConstraints ts)+          constraintsMap = Core.typeSchemeConstraints ts           typeParams =                   Lists.map (\v -> Typing.TypeParameter {                     Typing.typeParameterName = v,-                    Typing.typeParameterConstraints = (Optionals.match (Maps.lookup v constraintsMap) [] (\tvm -> Core.typeVariableConstraintsClasses tvm))}) variables+                    Typing.typeParameterConstraints = (Optionals.match (Maps.lookup v constraintsMap) [] (\tvm -> Sets.toList (Core.typeVariableConstraintsClasses tvm)))}) variables           peel =                   \acc -> \t -> case t of                     Core.TypeFunction v0 -> peel (Lists.cons (Core.functionTypeDomain v0) acc) (Core.functionTypeCodomain v0)@@ -196,7 +194,7 @@                       Lists.cons (Typing.Parameter {                         Typing.parameterName = (Core.Name (Strings.concat [                           "arg",-                          (Literals.showInt32 i)])),+                          (Literals.printInt32 i)])),                         Typing.parameterDescription = Nothing,                         Typing.parameterType = ty,                         Typing.parameterIsLazy = False}) pairAcc,
src/main/haskell/Hydra/Serialization.hs view
@@ -45,6 +45,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Angle bracket pair `<` `>` for use with `brackets` angleBraces :: Ast.Brackets@@ -55,7 +56,7 @@  -- | Comma-separate the elements inside angle brackets in the given block style; renders as `<>` when empty angleBracesList :: Ast.BlockStyle -> [Ast.Expr] -> Ast.Expr-angleBracesList style els = Logic.ifElse (Lists.null els) (cst "<>") (brackets angleBraces style (commaSep style els))+angleBracesList style els = Logic.ifElse (Lists.isEmpty els) (cst "<>") (brackets angleBraces style (commaSep style els))  -- | Produce a bracketed list which separates elements by spaces or newlines depending on the estimated width of the expression. bracesListAdaptive :: [Ast.Expr] -> Ast.Expr@@ -64,7 +65,7 @@  -- | Comma-separate the elements inside square brackets in the given block style; renders as `[]` when empty bracketList :: Ast.BlockStyle -> [Ast.Expr] -> Ast.Expr-bracketList style els = Logic.ifElse (Lists.null els) (cst "[]") (brackets squareBrackets style (commaSep style els))+bracketList style els = Logic.ifElse (Lists.isEmpty els) (cst "[]") (brackets squareBrackets style (commaSep style els))  -- | Produce a bracketed list which separates elements by spaces or newlines depending on the estimated width of the expression. bracketListAdaptive :: [Ast.Expr] -> Ast.Expr@@ -110,7 +111,7 @@ -- | Separate the elements inside curly braces using the given symbol (default `,`) in the given block style; renders as `{}` when empty curlyBracesList :: Maybe String -> Ast.BlockStyle -> [Ast.Expr] -> Ast.Expr curlyBracesList msymb style els =-    Logic.ifElse (Lists.null els) (cst "{}") (brackets curlyBraces style (symbolSep (Optionals.withDefault "," msymb) style els))+    Logic.ifElse (Lists.isEmpty els) (cst "{}") (brackets curlyBraces style (symbolSep (Optionals.withDefault "," msymb) style els))  -- | Indent every non-empty line of `s` by `idt`. Empty lines stay empty (no trailing whitespace) so downstream byte-identity checks don't care about indent depth. customIndent :: String -> String -> String@@ -266,7 +267,7 @@ infixWsList op opers =        let opExpr = cst op-          foldFun = \e -> \r -> Logic.ifElse (Lists.null e) [+          foldFun = \e -> \r -> Logic.ifElse (Lists.isEmpty e) [                 r] (Lists.cons r (Lists.cons opExpr e))       in (spaceSep (Lists.foldl foldFun [] (Lists.reverse opers))) @@ -313,7 +314,7 @@  -- | Construct a constant expression from an int32 num :: Int -> Ast.Expr-num i = cst (Literals.showInt32 i)+num i = cst (Literals.printInt32 i)  -- | Build an op with single-space padding from a symbol, precedence, and associativity op :: String -> Int -> Ast.Associativity -> Ast.Op@@ -349,7 +350,7 @@ parenList newlines els =        let style = Logic.ifElse (Logic.and newlines (Ordering.gt (Lists.length els) 1)) halfBlockStyle inlineStyle-      in (Logic.ifElse (Lists.null els) (cst "()") (brackets parentheses style (commaSep style els)))+      in (Logic.ifElse (Lists.isEmpty els) (cst "()") (brackets parentheses style (commaSep style els)))  -- | Produce a parenthesized list which separates elements by spaces or newlines depending on the estimated width of the expression. parenListAdaptive :: [Ast.Expr] -> Ast.Expr@@ -574,7 +575,7 @@ -- | Like sep, but produces a SeqExpr instead of an OpExpr chain. SeqExpr is treated as structural layout and is not subject to parenthesization. structuralSep :: Ast.Op -> [Ast.Expr] -> Ast.Expr structuralSep op els =-    Logic.ifElse (Lists.null els) (cst "") (Logic.ifElse (Equality.equal (Lists.length els) 1) (Optionals.withDefault (cst "") (Lists.head els)) (Ast.ExprSeq (Ast.SeqExpr {+    Logic.ifElse (Lists.isEmpty els) (cst "") (Logic.ifElse (Equality.equal (Lists.length els) 1) (Optionals.withDefault (cst "") (Lists.head els)) (Ast.ExprSeq (Ast.SeqExpr {       Ast.seqExprOp = op,       Ast.seqExprElements = els}))) 
+ src/main/haskell/Hydra/Shredding.hs view
@@ -0,0 +1,216 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Shredding: the total, injective decomposition of a typed graph's bindings into flat, path-addressed links (edges, properties, attributes) — the link view of a graph.++module Hydra.Shredding where++import qualified Hydra.Ast as Ast+import qualified Hydra.Coders as Coders+import qualified Hydra.Core as Core+import qualified Hydra.Docs as Docs+import qualified Hydra.Error.Checking as Checking+import qualified Hydra.Error.Core as ErrorCore+import qualified Hydra.Error.File as ErrorFile+import qualified Hydra.Error.Packaging as ErrorPackaging+import qualified Hydra.Error.System as ErrorSystem+import qualified Hydra.Errors as Errors+import qualified Hydra.File as File+import qualified Hydra.Graph as Graph+import qualified Hydra.Json.Model as Model+import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers+import qualified Hydra.Overlay.Haskell.Lib.Lists as Lists+import qualified Hydra.Overlay.Haskell.Lib.Logic as Logic+import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps+import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Overlay.Haskell.Lib.Pairs as Pairs+import qualified Hydra.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings+import qualified Hydra.Packaging as Packaging+import qualified Hydra.Parsing as Parsing+import qualified Hydra.Paths as Paths+import qualified Hydra.Query as Query+import qualified Hydra.Regex as Regex+import qualified Hydra.Relational as Relational+import qualified Hydra.Rewriting as Rewriting+import qualified Hydra.System as System+import qualified Hydra.Tabular as Tabular+import qualified Hydra.Testing as Testing+import qualified Hydra.Time as Time+import qualified Hydra.Topology as Topology+import qualified Hydra.Typed as Typed+import qualified Hydra.Typing as Typing+import qualified Hydra.Util as Util+import qualified Hydra.Validation as Validation+import qualified Hydra.Variants as Variants+import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines)+import qualified Data.Scientific as Sci+import Data.Void+import qualified Data.Map as M+import qualified Data.Set as S++-- | The link view of a typed graph: one node per bound term, each with the edge/property/attribute links found by a complete traversal of its term. Input must be typed (binding type schemes present); an untyped binding is a precondition failure, not a degraded mode.+shredGraph :: Graph.Graph -> Either Errors.Error Paths.SubtermGraph+shredGraph graph =++      let boundTerms = Graph.graphBoundTerms graph+          boundTypes = Graph.graphBoundTypes graph+      in (Eithers.map (\nodes -> Paths.SubtermGraph {+        Paths.subtermGraphNodes = nodes}) (Eithers.mapList (\nt ->+        let name = Pairs.first nt+            term = Pairs.second nt+        in (Optionals.match (Maps.lookup name boundTypes) (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat2 "shredGraph: untyped binding: " (Core.unName name))))) (\ts -> shredTerm graph name ts term))) (Maps.toList boundTerms)))++-- | The link view of a schema: one node per named type. A Type.variable referencing a schema-bound name is an edge; a forall-bound variable in scope is a property; leaf types are properties.+shredSchema :: M.Map Core.Name Core.Type -> Either Errors.Error Paths.SubtypeGraph+shredSchema schema =++      let schemaNames =+              Maps.fromList (Lists.map (\nt -> (+                Pairs.first nt,+                Core.TypeScheme {+                  Core.typeSchemeVariables = [],+                  Core.typeSchemeBody = (Pairs.second nt),+                  Core.typeSchemeConstraints = Maps.empty})) (Maps.toList schema))+      in (Eithers.map (\nodes -> Paths.SubtypeGraph {+        Paths.subtypeGraphNodes = nodes}) (Eithers.mapList (\nt -> shredType schemaNames (Pairs.first nt) (Pairs.second nt)) (Maps.toList schema)))++-- | Shred one binding (name, type scheme, term) of a graph into a subterm node+shredTerm :: Graph.Graph -> Core.Name -> Core.TypeScheme -> Core.Term -> Either Errors.Error Paths.SubtermNode+shredTerm graph name ts term =+    Eithers.map (\links -> Paths.SubtermNode {+      Paths.subtermNodeName = name,+      Paths.subtermNodeType = ts,+      Paths.subtermNodeLinks = links}) (shredTermLinks graph Sets.empty (Paths.SubtermPath []) term)++-- | Compute the outgoing links of a term at the given path, given the local scope of names bound by lambda/let steps already taken. Leaf terms yield a property or edge; a variable is classified as an edge (bound in the graph), a property (locally bound or a primitive), or a failure (free).+shredTermLinks :: Graph.Graph -> S.Set Core.Name -> Paths.SubtermPath -> Core.Term -> Either Errors.Error [Paths.SubtermLink]+shredTermLinks graph scope path term =++      let steps = Paths.unSubtermPath path+          attrs = Lists.map (\x -> Paths.SubtermLinkAttribute x) (termAttributes path term)+          childScope =+                  case term of+                    Core.TermLambda v0 -> Sets.insert (Core.lambdaParameter v0) scope+                    Core.TermLet v0 -> Lists.foldl (\acc -> \b -> Sets.insert (Core.bindingName b) acc) scope (Core.letBindings v0)+                    _ -> scope+          leafLinks =+                  case term of+                    Core.TermLiteral _ -> Right [+                      Paths.SubtermLinkProperty (Paths.SubtermProperty {+                        Paths.subtermPropertyPath = path,+                        Paths.subtermPropertyTarget = term})]+                    Core.TermProject _ -> Right [+                      Paths.SubtermLinkProperty (Paths.SubtermProperty {+                        Paths.subtermPropertyPath = path,+                        Paths.subtermPropertyTarget = term})]+                    Core.TermUnit -> Right [+                      Paths.SubtermLinkProperty (Paths.SubtermProperty {+                        Paths.subtermPropertyPath = path,+                        Paths.subtermPropertyTarget = term})]+                    Core.TermUnwrap _ -> Right [+                      Paths.SubtermLinkProperty (Paths.SubtermProperty {+                        Paths.subtermPropertyPath = path,+                        Paths.subtermPropertyTarget = term})]+                    Core.TermVariable v0 -> Logic.ifElse (Sets.member v0 scope) (Right [+                      Paths.SubtermLinkProperty (Paths.SubtermProperty {+                        Paths.subtermPropertyPath = path,+                        Paths.subtermPropertyTarget = term})]) (Logic.ifElse (Maps.member v0 (Graph.graphBoundTerms graph)) (Right [+                      Paths.SubtermLinkEdge (Paths.SubtermEdge {+                        Paths.subtermEdgePath = path,+                        Paths.subtermEdgeTarget = v0})]) (Logic.ifElse (Maps.member v0 (Graph.graphPrimitives graph)) (Right [+                      Paths.SubtermLinkProperty (Paths.SubtermProperty {+                        Paths.subtermPropertyPath = path,+                        Paths.subtermPropertyTarget = term})]) (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat2 "free variable in shredded term: " (Core.unName v0)))))))+                    _ -> Right []+      in (Eithers.bind (Eithers.mapList (\st ->+        let step = Pairs.first st+            child = Pairs.second st+            childPath = Paths.SubtermPath (Lists.concat2 steps [+                  step])+        in (shredTermLinks graph childScope childPath child)) (Rewriting.subtermsWithSteps term)) (\childLinkLists -> Eithers.bind leafLinks (\leaf -> Right (Lists.concat2 attrs (Lists.concat2 leaf (Lists.concat childLinkLists))))))++-- | Shred one named type of a schema into a subtype node+shredType :: M.Map Core.Name t0 -> Core.Name -> Core.Type -> Either Errors.Error Paths.SubtypeNode+shredType schema name typ =+    Eithers.map (\links -> Paths.SubtypeNode {+      Paths.subtypeNodeName = name,+      Paths.subtypeNodeLinks = links}) (shredTypeLinks schema Sets.empty (Paths.SubtypePath []) typ)++-- | Compute the outgoing links of a type at the given path, given the scope of forall-bound variables. A leaf type yields a property; a variable is an edge (a named type in the schema), a property (forall-bound in scope), or a failure (free).+shredTypeLinks :: M.Map Core.Name t0 -> S.Set Core.Name -> Paths.SubtypePath -> Core.Type -> Either Errors.Error [Paths.SubtypeLink]+shredTypeLinks schema scope path typ =++      let steps = Paths.unSubtypePath path+          attrs = Lists.map (\x -> Paths.SubtypeLinkAttribute x) (typeAttributes path typ)+          childScope =+                  case typ of+                    Core.TypeForall v0 -> Sets.insert (Core.forallTypeParameter v0) scope+                    _ -> scope+          leafLinks =+                  case typ of+                    Core.TypeLiteral _ -> Right [+                      Paths.SubtypeLinkProperty (Paths.SubtypeProperty {+                        Paths.subtypePropertyPath = path,+                        Paths.subtypePropertyTarget = typ})]+                    Core.TypeUnit -> Right [+                      Paths.SubtypeLinkProperty (Paths.SubtypeProperty {+                        Paths.subtypePropertyPath = path,+                        Paths.subtypePropertyTarget = typ})]+                    Core.TypeVoid -> Right [+                      Paths.SubtypeLinkProperty (Paths.SubtypeProperty {+                        Paths.subtypePropertyPath = path,+                        Paths.subtypePropertyTarget = typ})]+                    Core.TypeVariable v0 -> Logic.ifElse (Sets.member v0 scope) (Right [+                      Paths.SubtypeLinkProperty (Paths.SubtypeProperty {+                        Paths.subtypePropertyPath = path,+                        Paths.subtypePropertyTarget = typ})]) (Logic.ifElse (Maps.member v0 schema) (Right [+                      Paths.SubtypeLinkEdge (Paths.SubtypeEdge {+                        Paths.subtypeEdgePath = path,+                        Paths.subtypeEdgeTarget = v0})]) (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat2 "free type variable in shredded type: " (Core.unName v0))))))+                    _ -> Right []+      in (Eithers.bind (Eithers.mapList (\st ->+        let step = Pairs.first st+            child = Pairs.second st+            childPath = Paths.SubtypePath (Lists.concat2 steps [+                  step])+        in (shredTypeLinks schema childScope childPath child)) (Rewriting.subtypesWithSteps typ)) (\childLinkLists -> Eithers.bind leafLinks (\leaf -> Right (Lists.concat2 attrs (Lists.concat2 leaf (Lists.concat childLinkLists))))))++-- | The attribute links contributed by a term constructor at the given path+termAttributes :: Paths.SubtermPath -> Core.Term -> [Paths.SubtermAttribute]+termAttributes path term =++      let attr =+              \a -> Paths.SubtermAttribute {+                Paths.subtermAttributePath = path,+                Paths.subtermAttributeTarget = a}+          one = \a -> [+                attr a]+      in case term of+        Core.TermCases v0 -> one (Paths.TermAttributeCasesTypeName (Core.caseStatementTypeName v0))+        Core.TermInject v0 -> one (Paths.TermAttributeInjectTypeName (Core.injectionTypeName v0))+        Core.TermLambda v0 -> Lists.concat2 [+          attr (Paths.TermAttributeLambdaParameter (Core.lambdaParameter v0))] (Optionals.match (Core.lambdaDomain v0) [] (\d -> [+          attr (Paths.TermAttributeLambdaDomainGiven d)]))+        Core.TermProject v0 -> [+          attr (Paths.TermAttributeProjectTypeName (Core.projectionTypeName v0)),+          (attr (Paths.TermAttributeProjectFieldName (Core.projectionFieldName v0)))]+        Core.TermRecord v0 -> one (Paths.TermAttributeRecordTypeName (Core.recordTypeName v0))+        Core.TermTypeApplication v0 -> one (Paths.TermAttributeTypeApplicationType (Core.typeApplicationTermType v0))+        Core.TermTypeLambda v0 -> one (Paths.TermAttributeTypeLambdaParameter (Core.typeLambdaParameter v0))+        Core.TermWrap v0 -> one (Paths.TermAttributeWrapTypeName (Core.wrappedTermTypeName v0))+        _ -> []++-- | The attribute links contributed by a type constructor at the given path+typeAttributes :: Paths.SubtypePath -> Core.Type -> [Paths.SubtypeAttribute]+typeAttributes path typ =++      let attr =+              \a -> Paths.SubtypeAttribute {+                Paths.subtypeAttributePath = path,+                Paths.subtypeAttributeTarget = a}+      in case typ of+        Core.TypeAnnotated v0 -> [+          attr (Paths.TypeAttributeAnnotatedAnnotation (Core.annotatedTypeAnnotation v0))]+        Core.TypeForall v0 -> [+          attr (Paths.TypeAttributeForallParameter (Core.forallTypeParameter v0))]+        _ -> []
src/main/haskell/Hydra/Sorting.hs view
@@ -46,6 +46,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S @@ -108,7 +109,7 @@       let visit =               \visited -> \node ->                 let toVisit = Sets.difference (adj node) visited-                in (Logic.ifElse (Sets.null toVisit) visited (Lists.foldl (\v -> \n -> visit (Sets.insert n v) n) visited (Sets.toList toVisit)))+                in (Logic.ifElse (Sets.isEmpty toVisit) visited (Lists.foldl (\v -> \n -> visit (Sets.insert n v) n) visited (Sets.toList toVisit)))       in (visit (Sets.singleton root) root)  -- | Initial state for Tarjan's algorithm@@ -232,7 +233,7 @@       let sccs = topologicalSortComponents pairs           isCycle = \scc -> Ordering.gt (Lists.length scc) 1           withCycles = Lists.filter isCycle sccs-      in (Logic.ifElse (Lists.null withCycles) (Right (Lists.concat sccs)) (Left withCycles))+      in (Logic.ifElse (Lists.isEmpty withCycles) (Right (Lists.concat sccs)) (Left withCycles))  -- | Find the strongly connected components (including cycles and isolated vertices) of a graph, in (reverse) topological order, i.e. dependencies before dependents topologicalSortComponents :: Ord t0 => ([(t0, [t0])] -> [[t0]])
src/main/haskell/Hydra/Strip.hs view
@@ -37,6 +37,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Strip type annotations from the top levels of a term deannotateAndDetypeTerm :: Core.Term -> Core.Term
src/main/haskell/Hydra/Substitution.hs view
@@ -5,6 +5,7 @@ module Hydra.Substitution where  import qualified Hydra.Ast as Ast+import qualified Hydra.Classes as Classes import qualified Hydra.Coders as Coders import qualified Hydra.Core as Core import qualified Hydra.Docs as Docs@@ -21,8 +22,10 @@ import qualified Hydra.Overlay.Haskell.Lib.Logic as Logic import qualified Hydra.Overlay.Haskell.Lib.Maps as Maps import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Overlay.Haskell.Lib.Ordering as Ordering import qualified Hydra.Overlay.Haskell.Lib.Pairs as Pairs import qualified Hydra.Overlay.Haskell.Lib.Sets as Sets+import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings import qualified Hydra.Packaging as Packaging import qualified Hydra.Parsing as Parsing import qualified Hydra.Paths as Paths@@ -43,12 +46,13 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | Compose two type substitutions composeTypeSubst :: Typing.TypeSubst -> Typing.TypeSubst -> Typing.TypeSubst composeTypeSubst s1 s2 =-    Logic.ifElse (Maps.null (Typing.unTypeSubst s1)) s2 (Logic.ifElse (Maps.null (Typing.unTypeSubst s2)) s1 (composeTypeSubstNonEmpty s1 s2))+    Logic.ifElse (Maps.isEmpty (Typing.unTypeSubst s1)) s2 (Logic.ifElse (Maps.isEmpty (Typing.unTypeSubst s2)) s1 (composeTypeSubstNonEmpty s1 s2))  -- | Compose a list of type substitutions composeTypeSubstList :: [Typing.TypeSubst] -> Typing.TypeSubst@@ -70,23 +74,30 @@ singletonTypeSubst :: Core.Name -> Core.Type -> Typing.TypeSubst singletonTypeSubst v t = Typing.TypeSubst (Maps.singleton v t) --- | Apply a type substitution to class constraints, propagating to free variables or retaining on concrete resolution+-- | Apply a type substitution to class constraints, propagating to free variables or discharging/retaining on concrete resolution substInClassConstraints :: Typing.TypeSubst -> M.Map Core.Name Core.TypeVariableConstraints -> M.Map Core.Name Core.TypeVariableConstraints substInClassConstraints subst constraints =        let substMap = Typing.unTypeSubst subst-          insertOrMerge =-                  \varName -> \metadata -> \acc -> Optionals.match (Maps.lookup varName acc) (Maps.insert varName metadata acc) (\existing ->-                    let merged =-                            Core.TypeVariableConstraints {-                              Core.typeVariableConstraintsClasses = (Lists.distinct (Lists.concat2 (Core.typeVariableConstraintsClasses existing) (Core.typeVariableConstraintsClasses metadata)))}-                    in (Maps.insert varName merged acc))-      in (Lists.foldl (\acc -> \pair ->-        let varName = Pairs.first pair-            metadata = Pairs.second pair-        in (Optionals.match (Maps.lookup varName substMap) (insertOrMerge varName metadata acc) (\targetType ->-          let freeVars = Sets.toList (Variables.freeVariablesInType targetType)-          in (Logic.ifElse (Lists.null freeVars) (insertOrMerge varName metadata acc) (Lists.foldl (\acc2 -> \freeVar -> insertOrMerge freeVar metadata acc2) acc freeVars))))) Maps.empty (Maps.toList constraints))+      in (Logic.ifElse (Logic.or (Maps.isEmpty substMap) (Maps.isEmpty constraints)) constraints (+        let isGenuineVarName = \name -> Ordering.lte (Lists.length (Strings.splitOn "." (Core.unName name))) 1+            insertOrMerge =+                    \varName -> \metadata -> \acc -> Optionals.match (Maps.lookup varName acc) (Maps.insert varName metadata acc) (\existing ->+                      let merged =+                              Core.TypeVariableConstraints {+                                Core.typeVariableConstraintsClasses = (Sets.union (Core.typeVariableConstraintsClasses existing) (Core.typeVariableConstraintsClasses metadata))}+                      in (Maps.insert varName merged acc))+        in (Lists.foldl (\acc -> \pair ->+          let varName = Pairs.first pair+              metadata = Pairs.second pair+          in (Optionals.match (Maps.lookup varName substMap) (insertOrMerge varName metadata acc) (\targetType ->+            let genuineVars = Lists.filter isGenuineVarName (Sets.toList (Variables.freeVariablesInType targetType))+            in (Logic.ifElse (Logic.not (Lists.isEmpty genuineVars)) (Lists.foldl (\acc2 -> \freeVar -> insertOrMerge freeVar metadata acc2) acc genuineVars) (+              let unsatisfied =+                      Sets.filter (\c -> Logic.not (Classes.classIsSatisfiedByType (case c of+                        Core.TypeClassConstraintSimple v0 -> v0) targetType)) (Core.typeVariableConstraintsClasses metadata)+              in (Logic.ifElse (Sets.isEmpty unsatisfied) acc (insertOrMerge varName (Core.TypeVariableConstraints {+                Core.typeVariableConstraintsClasses = unsatisfied}) acc))))))) Maps.empty (Maps.toList constraints))))  -- | Apply a type substitution to a graph's bound types and class constraints substInContext :: Typing.TypeSubst -> Graph.Graph -> Graph.Graph@@ -116,7 +127,7 @@  -- | Apply a type substitution to a type substInType :: Typing.TypeSubst -> Core.Type -> Core.Type-substInType subst typ0 = Logic.ifElse (Maps.null (Typing.unTypeSubst subst)) typ0 (substInTypeNonEmpty subst typ0)+substInType subst typ0 = Logic.ifElse (Maps.isEmpty (Typing.unTypeSubst subst)) typ0 (substInTypeNonEmpty subst typ0)  -- | Apply a non-empty type substitution to a type (internal helper) substInTypeNonEmpty :: Typing.TypeSubst -> Core.Type -> Core.Type@@ -141,7 +152,7 @@       in Core.TypeScheme {         Core.typeSchemeVariables = (Core.typeSchemeVariables ts),         Core.typeSchemeBody = (substInType scopedSubst (Core.typeSchemeBody ts)),-        Core.typeSchemeConstraints = (Optionals.map (substInClassConstraints scopedSubst) (Core.typeSchemeConstraints ts))}+        Core.typeSchemeConstraints = (substInClassConstraints scopedSubst (Core.typeSchemeConstraints ts))}  -- | Apply a type substitution to the type annotations within a term substTypesInTerm :: Typing.TypeSubst -> Core.Term -> Core.Term
src/main/haskell/Hydra/System.hs view
@@ -8,6 +8,7 @@ import qualified Hydra.File as File import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.ByteString as B import qualified Data.Map as M 
src/main/haskell/Hydra/Tabular.hs view
@@ -8,6 +8,7 @@ import qualified Hydra.Relational as Relational import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | A column type, consisting of a name and a value type data ColumnType =
src/main/haskell/Hydra/Templates.hs view
@@ -44,6 +44,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Hydra.Overlay.Haskell.Lib.Literals as Literals 
src/main/haskell/Hydra/Test/Transform.hs view
@@ -43,6 +43,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Add generation namespace prefix addGenerationPrefix :: Packaging.ModuleName -> Packaging.ModuleName@@ -136,7 +137,7 @@           cases_ = Testing.testGroupCases tg           transformedCases = Optionals.givens (Lists.map (\tc -> transformTestCase tc) cases_)           transformedSubgroups = Optionals.givens (Lists.map (\sg -> transformToCompiledTests sg) subgroups)-      in (Logic.ifElse (Logic.and (Lists.null transformedCases) (Lists.null transformedSubgroups)) Nothing (Just (Testing.TestGroup {+      in (Logic.ifElse (Logic.and (Lists.isEmpty transformedCases) (Lists.isEmpty transformedSubgroups)) Nothing (Just (Testing.TestGroup {         Testing.testGroupName = name_,         Testing.testGroupDescription = desc,         Testing.testGroupSubgroups = transformedSubgroups,
src/main/haskell/Hydra/Test/Utils.hs view
@@ -39,6 +39,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | Run type inference on a single term inferTerm :: Graph.Graph -> Core.Term -> Either String Core.Term
src/main/haskell/Hydra/Testing.hs view
@@ -7,6 +7,7 @@ import qualified Hydra.Core as Core import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | An effectful test case: the actual value is a thunk producing an effect, which the test runner interprets (performing host interactions, e.g. file I/O within a per-case empty temporary directory) to obtain a result string; the expected value is a thunk producing a string. data EffectfulTestCase =
src/main/haskell/Hydra/Time.hs view
@@ -7,6 +7,7 @@ import qualified Hydra.Core as Core import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Int as I  -- | The POSIX struct timespec, with the same semantics: an instant in time as a number of seconds and nanoseconds since the Unix Epoch (1970-01-01T00:00:00Z). The actual resolution is implementation- and filesystem-defined. See <time.h> (https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/time.h.html) and XBD section 4.19, "Seconds Since the Epoch" (https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/V1_chap04.html#tag_04_19).
src/main/haskell/Hydra/Topology.hs view
@@ -7,6 +7,7 @@ import qualified Hydra.Core as Core import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S 
src/main/haskell/Hydra/Typed.hs view
@@ -7,6 +7,7 @@ import qualified Hydra.Core as Core import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | An association of a named term (element) with a phantom type data TypedBinding a =
src/main/haskell/Hydra/Typing.hs view
@@ -8,6 +8,7 @@ import qualified Hydra.Paths as Paths import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | A structured representation of a function term's components, replacing ad-hoc tuples. This captures all the information extracted from peeling lambdas, type lambdas, lets, and type applications from a term.
src/main/haskell/Hydra/Unification.hs view
@@ -47,6 +47,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | Join two types, producing a list of type constraints.The comment is used to provide context for the constraints.
src/main/haskell/Hydra/Util.hs view
@@ -8,6 +8,7 @@ import qualified Hydra.Packaging as Packaging import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | A naming convention for symbols, such as camelCase or snake_case
src/main/haskell/Hydra/Validate/Core.hs view
@@ -49,6 +49,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Set as S  -- | Append a rule-tagged InvalidTermError finding to a ValidationResult, classifying as error or warning per the profile and respecting maxErrors/maxWarnings bounds.@@ -133,7 +134,7 @@         let body = Core.annotatedTermBody v0             annMap = Annotations.getAnnotationMap (Core.annotatedTermAnnotation v0)         in (firstFinding [-          Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTermError.emptyTermAnnotation")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTermError.emptyTermAnnotation", f)) (Logic.ifElse (Maps.null annMap) (Just (ErrorCore.InvalidTermErrorEmptyTermAnnotation (ErrorCore.EmptyTermAnnotationError {+          Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTermError.emptyTermAnnotation")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTermError.emptyTermAnnotation", f)) (Logic.ifElse (Maps.isEmpty annMap) (Just (ErrorCore.InvalidTermErrorEmptyTermAnnotation (ErrorCore.EmptyTermAnnotationError {             ErrorCore.emptyTermAnnotationErrorLocation = path}))) Nothing)) Nothing,           (Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTermError.nestedTermAnnotation")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTermError.nestedTermAnnotation", f)) (case body of             Core.TermAnnotated _ -> Just (ErrorCore.InvalidTermErrorNestedTermAnnotation (ErrorCore.NestedTermAnnotationError {@@ -199,14 +200,14 @@           (Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTermError.missingRecordFields")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTermError.missingRecordFields", f)) (Optionals.match (resolveRecordFields cx tname) Nothing (\declFields ->             let declNames = Sets.fromList (Lists.map Core.fieldTypeName declFields)                 missing = Sets.difference declNames suppliedNames-            in (Logic.ifElse (Sets.null missing) Nothing (Just (ErrorCore.InvalidTermErrorMissingRecordFields (ErrorCore.MissingRecordFieldsError {+            in (Logic.ifElse (Sets.isEmpty missing) Nothing (Just (ErrorCore.InvalidTermErrorMissingRecordFields (ErrorCore.MissingRecordFieldsError {               ErrorCore.missingRecordFieldsErrorLocation = path,               ErrorCore.missingRecordFieldsErrorTypeName = tname,               ErrorCore.missingRecordFieldsErrorFieldNames = (Sets.toList missing)}))))))) Nothing),           (Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTermError.extraRecordFields")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTermError.extraRecordFields", f)) (Optionals.match (resolveRecordFields cx tname) Nothing (\declFields ->             let declNames = Sets.fromList (Lists.map Core.fieldTypeName declFields)                 extra = Sets.difference suppliedNames declNames-            in (Logic.ifElse (Sets.null extra) Nothing (Just (ErrorCore.InvalidTermErrorExtraRecordFields (ErrorCore.ExtraRecordFieldsError {+            in (Logic.ifElse (Sets.isEmpty extra) Nothing (Just (ErrorCore.InvalidTermErrorExtraRecordFields (ErrorCore.ExtraRecordFieldsError {               ErrorCore.extraRecordFieldsErrorLocation = path,               ErrorCore.extraRecordFieldsErrorTypeName = tname,               ErrorCore.extraRecordFieldsErrorFieldNames = (Sets.toList extra)}))))))) Nothing)])@@ -214,7 +215,7 @@         let bindings = Core.letBindings v0             names = Lists.map Core.bindingName bindings         in (firstFinding [-          Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTermError.emptyLetBindings")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTermError.emptyLetBindings", f)) (Logic.ifElse (Lists.null bindings) (Just (ErrorCore.InvalidTermErrorEmptyLetBindings (ErrorCore.EmptyLetBindingsError {+          Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTermError.emptyLetBindings")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTermError.emptyLetBindings", f)) (Logic.ifElse (Lists.isEmpty bindings) (Just (ErrorCore.InvalidTermErrorEmptyLetBindings (ErrorCore.EmptyLetBindingsError {             ErrorCore.emptyLetBindingsErrorLocation = path}))) Nothing)) Nothing,           (Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTermError.duplicateBinding")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTermError.duplicateBinding", f)) (checkDuplicateBindings path bindings)) Nothing),           Nothing,@@ -302,14 +303,14 @@               ErrorCore.nominalTypeKindMismatchErrorTypeName = tname,               ErrorCore.nominalTypeKindMismatchErrorExpectedVariant = Variants.TypeVariantUnion,               ErrorCore.nominalTypeKindMismatchErrorActualVariant = (Reflect.typeVariant typ)}))))) Nothing),-          (Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTermError.emptyCaseStatement")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTermError.emptyCaseStatement", f)) (Logic.ifElse (Logic.and (Lists.null csCases) (Optionals.isNone csDefault)) (Just (ErrorCore.InvalidTermErrorEmptyCaseStatement (ErrorCore.EmptyCaseStatementError {+          (Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTermError.emptyCaseStatement")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTermError.emptyCaseStatement", f)) (Logic.ifElse (Logic.and (Lists.isEmpty csCases) (Optionals.isNone csDefault)) (Just (ErrorCore.InvalidTermErrorEmptyCaseStatement (ErrorCore.EmptyCaseStatementError {             ErrorCore.emptyCaseStatementErrorLocation = path,             ErrorCore.emptyCaseStatementErrorTypeName = tname}))) Nothing)) Nothing),           (Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTermError.duplicateField")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTermError.duplicateField", f)) (checkDuplicateFields path (Lists.map Core.caseAlternativeName csCases))) Nothing),           (Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTermError.missingCaseBranches")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTermError.missingCaseBranches", f)) (Logic.ifElse (Optionals.isNone csDefault) (Optionals.match unionFields Nothing (\fields ->             let variantNames = Sets.fromList (Lists.map Core.fieldTypeName fields)                 uncovered = Sets.difference variantNames altNames-            in (Logic.ifElse (Sets.null uncovered) Nothing (Just (ErrorCore.InvalidTermErrorMissingCaseBranches (ErrorCore.MissingCaseBranchesError {+            in (Logic.ifElse (Sets.isEmpty uncovered) Nothing (Just (ErrorCore.InvalidTermErrorMissingCaseBranches (ErrorCore.MissingCaseBranchesError {               ErrorCore.missingCaseBranchesErrorLocation = path,               ErrorCore.missingCaseBranchesErrorTypeName = tname,               ErrorCore.missingCaseBranchesErrorVariantNames = (Sets.toList uncovered)})))))) Nothing)) Nothing),@@ -569,7 +570,7 @@         let body = Core.annotatedTypeBody v0             annMap = Annotations.getAnnotationMap (Core.annotatedTypeAnnotation v0)         in (firstFindingType [-          Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTypeError.emptyTypeAnnotation")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTypeError.emptyTypeAnnotation", f)) (Logic.ifElse (Maps.null annMap) (Just (ErrorCore.InvalidTypeErrorEmptyTypeAnnotation (ErrorCore.EmptyTypeAnnotationError {+          Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTypeError.emptyTypeAnnotation")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTypeError.emptyTypeAnnotation", f)) (Logic.ifElse (Maps.isEmpty annMap) (Just (ErrorCore.InvalidTypeErrorEmptyTypeAnnotation (ErrorCore.EmptyTypeAnnotationError {             ErrorCore.emptyTypeAnnotationErrorLocation = (Paths.SubtermPath [])}))) Nothing)) Nothing,           (Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTypeError.nestedTypeAnnotation")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTypeError.nestedTypeAnnotation", f)) (case body of             Core.TypeAnnotated _ -> Just (ErrorCore.InvalidTypeErrorNestedTypeAnnotation (ErrorCore.NestedTypeAnnotationError {@@ -604,7 +605,7 @@         Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTypeError.voidInNonBottomPosition")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTypeError.voidInNonBottomPosition", f)) (checkVoid (Core.pairTypeFirst v0))) Nothing,         (Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTypeError.voidInNonBottomPosition")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTypeError.voidInNonBottomPosition", f)) (checkVoid (Core.pairTypeSecond v0))) Nothing)]       Core.TypeRecord v0 -> firstFindingType [-        Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTypeError.emptyRecordType")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTypeError.emptyRecordType", f)) (Logic.ifElse (Lists.null v0) (Just (ErrorCore.InvalidTypeErrorEmptyRecordType (ErrorCore.EmptyRecordTypeError {+        Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTypeError.emptyRecordType")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTypeError.emptyRecordType", f)) (Logic.ifElse (Lists.isEmpty v0) (Just (ErrorCore.InvalidTypeErrorEmptyRecordType (ErrorCore.EmptyRecordTypeError {           ErrorCore.emptyRecordTypeErrorLocation = (Paths.SubtermPath [])}))) Nothing)) Nothing,         (Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTypeError.duplicateRecordTypeFieldNames")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTypeError.duplicateRecordTypeFieldNames", f)) (checkDuplicateFieldTypes v0 (\dupName -> Just (ErrorCore.InvalidTypeErrorDuplicateRecordTypeFieldNames (ErrorCore.DuplicateRecordTypeFieldNamesError {           ErrorCore.duplicateRecordTypeFieldNamesErrorLocation = (Paths.SubtermPath []),@@ -618,7 +619,7 @@           _ -> Nothing)) Nothing,         (Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTypeError.voidInNonBottomPosition")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTypeError.voidInNonBottomPosition", f)) (checkVoid v0)) Nothing)]       Core.TypeUnion v0 -> firstFindingType [-        Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTypeError.emptyUnionType")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTypeError.emptyUnionType", f)) (Logic.ifElse (Lists.null v0) (Just (ErrorCore.InvalidTypeErrorEmptyUnionType (ErrorCore.EmptyUnionTypeError {+        Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTypeError.emptyUnionType")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTypeError.emptyUnionType", f)) (Logic.ifElse (Lists.isEmpty v0) (Just (ErrorCore.InvalidTypeErrorEmptyUnionType (ErrorCore.EmptyUnionTypeError {           ErrorCore.emptyUnionTypeErrorLocation = (Paths.SubtermPath [])}))) Nothing)) Nothing,         (Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTypeError.singleVariantUnion")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTypeError.singleVariantUnion", f)) (Logic.ifElse (Equality.equal (Lists.length v0) 1) (Optionals.match (Lists.head v0) Nothing (\singleField -> Just (ErrorCore.InvalidTypeErrorSingleVariantUnion (ErrorCore.SingleVariantUnionError {           ErrorCore.singleVariantUnionErrorLocation = (Paths.SubtermPath []),
src/main/haskell/Hydra/Validate/Packaging.hs view
@@ -51,6 +51,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S 
src/main/haskell/Hydra/Validation.hs view
@@ -8,6 +8,7 @@ import qualified Hydra.Error.Core as ErrorCore import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Set as S  -- | Configuration for a validation pass: which check rules are active, how each is classified, and the upper bounds on collected findings. A check whose rule name appears in neither set is never evaluated. Errors hard-stop the traversal once maxErrors is reached; warnings only stop being collected once maxWarnings is reached, never causing termination.
src/main/haskell/Hydra/Variables.hs view
@@ -47,6 +47,7 @@ import qualified Hydra.Variants as Variants import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M import qualified Data.Set as S @@ -188,7 +189,7 @@                                                                     k = Lists.length vars                                                                     gen =                                                                             \i -> \rem -> \acc2 ->-                                                                              let ti = Core.Name (Strings.concat2 "t" (Literals.showInt32 (Math.add next i)))+                                                                              let ti = Core.Name (Strings.concat2 "t" (Literals.printInt32 (Math.add next i)))                                                                               in (Logic.ifElse (Equality.equal rem 0) (Lists.reverse acc2) (gen (Math.add i 1) (Math.sub rem 1) (Lists.cons ti acc2)))                                                                     newVars = gen 0 k []                                                                     newSubst = Maps.union (Maps.fromList (Lists.zip vars newVars)) subst@@ -201,7 +202,7 @@                                                                                   newName = Optionals.withDefault oldName (Maps.lookup oldName newSubst)                                                                               in (newName, meta)) (Maps.toList constraintMap))                                                                     oldConstraints = Core.typeSchemeConstraints ts-                                                                    newConstraints = Optionals.map renameConstraintKeys oldConstraints+                                                                    newConstraints = renameConstraintKeys oldConstraints                                                                     b1 =                                                                             Core.Binding {                                                                               Core.bindingName = (Core.bindingName b),@@ -290,7 +291,7 @@        let freshName =               \base -> \i -> \m ->-                let candidate = Core.Name (Strings.concat2 (Core.unName base) (Literals.showInt32 i))+                let candidate = Core.Name (Strings.concat2 (Core.unName base) (Literals.printInt32 i))                 in (Logic.ifElse (Maps.member candidate m) (freshName base (Math.add i 1) m) candidate)           f =                   \recurse -> \m -> \term -> case term of
src/main/haskell/Hydra/Variants.hs view
@@ -7,6 +7,7 @@ import qualified Hydra.Core as Core import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void  -- | The identifier of a literal constructor data LiteralVariant =
src/main/haskell/Hydra/Yaml/Model.hs view
@@ -11,6 +11,7 @@ import qualified Hydra.Core as Core import Prelude hiding  (Enum, Ordering, decodeFloat, encodeFloat, fail, lines, map, pure, sum, unlines) import qualified Data.Scientific as Sci+import Data.Void import qualified Data.Map as M  -- | A YAML node (value)