hydra-kernel 0.17.2 → 0.17.3
raw patch · 120 files changed
+3328/−4706 lines, 120 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- Hydra.Dsl.Lib.Eithers: foldl :: TypedTerm (x -> y -> Either z x) -> TypedTerm x -> TypedTerm [y] -> TypedTerm (Either z x)
- Hydra.Dsl.Lib.Eithers: fromLeft :: TypedTerm x -> TypedTerm (Either x y) -> TypedTerm x
- Hydra.Dsl.Lib.Eithers: fromRight :: TypedTerm y -> TypedTerm (Either x y) -> TypedTerm y
- Hydra.Dsl.Lib.Eithers: partitionEithers :: TypedTerm [Either x y] -> TypedTerm ([x], [y])
- Hydra.Dsl.Lib.Equality: compare :: TypedTerm x -> TypedTerm x -> TypedTerm Comparison
- Hydra.Dsl.Lib.Equality: gt :: TypedTerm x -> TypedTerm x -> TypedTerm Bool
- Hydra.Dsl.Lib.Equality: gte :: TypedTerm x -> TypedTerm x -> TypedTerm Bool
- Hydra.Dsl.Lib.Equality: identity :: TypedTerm x -> TypedTerm x
- Hydra.Dsl.Lib.Equality: lt :: TypedTerm x -> TypedTerm x -> TypedTerm Bool
- Hydra.Dsl.Lib.Equality: lte :: TypedTerm x -> TypedTerm x -> TypedTerm Bool
- Hydra.Dsl.Lib.Equality: max :: TypedTerm x -> TypedTerm x -> TypedTerm x
- Hydra.Dsl.Lib.Equality: min :: TypedTerm x -> TypedTerm x -> TypedTerm x
- Hydra.Dsl.Lib.Lists: elem :: TypedTerm x -> TypedTerm [x] -> TypedTerm Bool
- Hydra.Dsl.Lib.Lists: intercalate :: TypedTerm [x] -> TypedTerm [[x]] -> TypedTerm [x]
- Hydra.Dsl.Lib.Lists: maybeAt :: TypedTerm Int -> TypedTerm [x] -> TypedTerm (Maybe x)
- Hydra.Dsl.Lib.Lists: maybeHead :: TypedTerm [x] -> TypedTerm (Maybe x)
- Hydra.Dsl.Lib.Lists: maybeInit :: TypedTerm [x] -> TypedTerm (Maybe [x])
- Hydra.Dsl.Lib.Lists: maybeLast :: TypedTerm [x] -> TypedTerm (Maybe x)
- Hydra.Dsl.Lib.Lists: maybeTail :: TypedTerm [x] -> TypedTerm (Maybe [x])
- Hydra.Dsl.Lib.Lists: nub :: TypedTerm [x] -> TypedTerm [x]
- Hydra.Dsl.Lib.Lists: sortOn :: TypedTerm (x -> y) -> TypedTerm [x] -> TypedTerm [x]
- Hydra.Dsl.Lib.Literals: binaryToString :: TypedTerm ByteString -> TypedTerm String
- Hydra.Dsl.Lib.Literals: readBoolean :: TypedTerm String -> TypedTerm (Maybe Bool)
- Hydra.Dsl.Lib.Literals: readString :: TypedTerm String -> TypedTerm (Maybe String)
- Hydra.Dsl.Lib.Literals: showBoolean :: TypedTerm Bool -> TypedTerm String
- Hydra.Dsl.Lib.Literals: showString :: TypedTerm String -> TypedTerm String
- Hydra.Dsl.Lib.Literals: stringToBinary :: TypedTerm String -> TypedTerm ByteString
- Hydra.Dsl.Lib.Math: max :: TypedTerm Int -> TypedTerm Int -> TypedTerm Int
- Hydra.Dsl.Lib.Math: maybeDiv :: TypedTerm Int -> TypedTerm Int -> TypedTerm (Maybe Int)
- Hydra.Dsl.Lib.Math: maybeMod :: TypedTerm Int -> TypedTerm Int -> TypedTerm (Maybe Int)
- Hydra.Dsl.Lib.Math: maybePred :: TypedTerm Int -> TypedTerm (Maybe Int)
- Hydra.Dsl.Lib.Math: maybeRem :: TypedTerm Int -> TypedTerm Int -> TypedTerm (Maybe Int)
- Hydra.Dsl.Lib.Math: maybeSucc :: TypedTerm Int -> TypedTerm (Maybe Int)
- Hydra.Dsl.Lib.Math: min :: TypedTerm Int -> TypedTerm Int -> TypedTerm Int
- Hydra.Dsl.Lib.Optionals: cat :: TypedTerm [Maybe x] -> TypedTerm [x]
- Hydra.Dsl.Lib.Optionals: fromOptional :: TypedTerm x -> TypedTerm (Maybe x) -> TypedTerm x
- Hydra.Dsl.Lib.Strings: cat :: TypedTerm [String] -> TypedTerm String
- Hydra.Dsl.Lib.Strings: cat2 :: TypedTerm String -> TypedTerm String -> TypedTerm String
- Hydra.Dsl.Lib.Strings: intercalate :: TypedTerm String -> TypedTerm [String] -> TypedTerm String
- Hydra.Dsl.Lib.Strings: maybeCharAt :: TypedTerm Int -> TypedTerm String -> TypedTerm (Maybe Int)
- Hydra.Lib.Effects: foldl :: PrimitiveDefinition
- Hydra.Lib.Eithers: foldl :: PrimitiveDefinition
- Hydra.Lib.Eithers: fromLeft :: PrimitiveDefinition
- Hydra.Lib.Eithers: fromRight :: PrimitiveDefinition
- Hydra.Lib.Eithers: partitionEithers :: PrimitiveDefinition
- Hydra.Lib.Equality: compare :: PrimitiveDefinition
- Hydra.Lib.Equality: gt :: PrimitiveDefinition
- Hydra.Lib.Equality: gte :: PrimitiveDefinition
- Hydra.Lib.Equality: identity :: PrimitiveDefinition
- Hydra.Lib.Equality: lt :: PrimitiveDefinition
- Hydra.Lib.Equality: lte :: PrimitiveDefinition
- Hydra.Lib.Equality: max :: PrimitiveDefinition
- Hydra.Lib.Equality: min :: PrimitiveDefinition
- Hydra.Lib.Lists: elem :: PrimitiveDefinition
- Hydra.Lib.Lists: intercalate :: PrimitiveDefinition
- Hydra.Lib.Lists: maybeAt :: PrimitiveDefinition
- Hydra.Lib.Lists: maybeHead :: PrimitiveDefinition
- Hydra.Lib.Lists: maybeInit :: PrimitiveDefinition
- Hydra.Lib.Lists: maybeLast :: PrimitiveDefinition
- Hydra.Lib.Lists: maybeTail :: PrimitiveDefinition
- Hydra.Lib.Lists: nub :: PrimitiveDefinition
- Hydra.Lib.Lists: sortOn :: PrimitiveDefinition
- Hydra.Lib.Literals: binaryToString :: PrimitiveDefinition
- Hydra.Lib.Literals: readBoolean :: PrimitiveDefinition
- Hydra.Lib.Literals: readString :: PrimitiveDefinition
- Hydra.Lib.Literals: showBoolean :: PrimitiveDefinition
- Hydra.Lib.Literals: showString :: PrimitiveDefinition
- Hydra.Lib.Literals: stringToBinary :: PrimitiveDefinition
- Hydra.Lib.Math: max :: PrimitiveDefinition
- Hydra.Lib.Math: maybeDiv :: PrimitiveDefinition
- Hydra.Lib.Math: maybeMod :: PrimitiveDefinition
- Hydra.Lib.Math: maybePred :: PrimitiveDefinition
- Hydra.Lib.Math: maybeRem :: PrimitiveDefinition
- Hydra.Lib.Math: maybeSucc :: PrimitiveDefinition
- Hydra.Lib.Math: min :: PrimitiveDefinition
- Hydra.Lib.Optionals: cat :: PrimitiveDefinition
- Hydra.Lib.Optionals: fromOptional :: PrimitiveDefinition
- Hydra.Lib.Strings: cat :: PrimitiveDefinition
- Hydra.Lib.Strings: cat2 :: PrimitiveDefinition
- Hydra.Lib.Strings: intercalate :: PrimitiveDefinition
- Hydra.Lib.Strings: maybeCharAt :: PrimitiveDefinition
- Hydra.Overlay.Haskell.Dsl.Prims: TypeVar :: String -> [Name] -> TypeVar
- Hydra.Overlay.Haskell.Dsl.Prims: [typeVarClasses] :: TypeVar -> [Name]
- Hydra.Overlay.Haskell.Dsl.Prims: [typeVarName] :: TypeVar -> String
- Hydra.Overlay.Haskell.Dsl.Prims: buildTypeScheme :: [TypeVar] -> Type -> TypeScheme
- Hydra.Overlay.Haskell.Dsl.Prims: data TypeVar
- Hydra.Overlay.Haskell.Dsl.Prims: defaultPrimitiveDefinition :: Name -> TypeScheme -> PrimitiveDefinition
- Hydra.Overlay.Haskell.Dsl.Prims: typeVarNames :: [TypeVar] -> [String]
- Hydra.Overlay.Haskell.Dsl.Prims: typeVarsToConstraints :: [TypeVar] -> [(String, [Name])]
- Hydra.Overlay.Haskell.Dsl.Prims: v :: String -> TypeVar
- Hydra.Overlay.Haskell.Dsl.Prims: vEq :: String -> TypeVar
- Hydra.Overlay.Haskell.Dsl.Prims: vOrd :: String -> TypeVar
- Hydra.Overlay.Haskell.Lib.Eithers: foldl :: (a -> b -> Either c a) -> a -> [b] -> Either c a
- Hydra.Overlay.Haskell.Lib.Eithers: fromLeft :: a -> Either a b -> a
- Hydra.Overlay.Haskell.Lib.Eithers: fromRight :: b -> Either a b -> b
- Hydra.Overlay.Haskell.Lib.Eithers: partitionEithers :: [Either a b] -> ([a], [b])
- Hydra.Overlay.Haskell.Lib.Equality: compare :: Ord a => a -> a -> Comparison
- Hydra.Overlay.Haskell.Lib.Equality: gt :: Ord a => a -> a -> Bool
- Hydra.Overlay.Haskell.Lib.Equality: gte :: Ord a => a -> a -> Bool
- Hydra.Overlay.Haskell.Lib.Equality: identity :: a -> a
- Hydra.Overlay.Haskell.Lib.Equality: lt :: Ord a => a -> a -> Bool
- Hydra.Overlay.Haskell.Lib.Equality: lte :: Ord a => a -> a -> Bool
- Hydra.Overlay.Haskell.Lib.Equality: max :: Ord a => a -> a -> a
- Hydra.Overlay.Haskell.Lib.Equality: min :: Ord a => a -> a -> a
- Hydra.Overlay.Haskell.Lib.Lists: elem :: Eq a => a -> [a] -> Bool
- Hydra.Overlay.Haskell.Lib.Lists: intercalate :: [a] -> [[a]] -> [a]
- Hydra.Overlay.Haskell.Lib.Lists: maybeAt :: Int -> [a] -> Maybe a
- Hydra.Overlay.Haskell.Lib.Lists: maybeHead :: [a] -> Maybe a
- Hydra.Overlay.Haskell.Lib.Lists: maybeInit :: [a] -> Maybe [a]
- Hydra.Overlay.Haskell.Lib.Lists: maybeLast :: [a] -> Maybe a
- Hydra.Overlay.Haskell.Lib.Lists: maybeTail :: [a] -> Maybe [a]
- Hydra.Overlay.Haskell.Lib.Lists: nub :: Eq a => [a] -> [a]
- Hydra.Overlay.Haskell.Lib.Lists: sortOn :: Ord b => (a -> b) -> [a] -> [a]
- Hydra.Overlay.Haskell.Lib.Literals: binaryToString :: ByteString -> String
- Hydra.Overlay.Haskell.Lib.Literals: readBoolean :: String -> Maybe Bool
- Hydra.Overlay.Haskell.Lib.Literals: readString :: String -> Maybe String
- Hydra.Overlay.Haskell.Lib.Literals: showBoolean :: Bool -> String
- Hydra.Overlay.Haskell.Lib.Literals: showString :: String -> String
- Hydra.Overlay.Haskell.Lib.Literals: stringToBinary :: String -> ByteString
- Hydra.Overlay.Haskell.Lib.Math: max :: Ord a => a -> a -> a
- Hydra.Overlay.Haskell.Lib.Math: maybeDiv :: Int -> Int -> Maybe Int
- Hydra.Overlay.Haskell.Lib.Math: maybeMod :: Int -> Int -> Maybe Int
- Hydra.Overlay.Haskell.Lib.Math: maybePred :: Int -> Maybe Int
- Hydra.Overlay.Haskell.Lib.Math: maybeRem :: Int -> Int -> Maybe Int
- Hydra.Overlay.Haskell.Lib.Math: maybeSucc :: Int -> Maybe Int
- Hydra.Overlay.Haskell.Lib.Math: min :: Ord a => a -> a -> a
- Hydra.Overlay.Haskell.Lib.Optionals: cat :: [Maybe a] -> [a]
- Hydra.Overlay.Haskell.Lib.Optionals: fromOptional :: a -> Maybe a -> a
- Hydra.Overlay.Haskell.Lib.Strings: cat :: [String] -> String
- Hydra.Overlay.Haskell.Lib.Strings: cat2 :: String -> String -> String
- Hydra.Overlay.Haskell.Lib.Strings: intercalate :: String -> [String] -> String
- Hydra.Overlay.Haskell.Lib.Strings: maybeCharAt :: Int -> String -> Maybe Int
- Hydra.Overlay.Haskell.Libraries: _a :: TypeVar
- Hydra.Overlay.Haskell.Libraries: _b :: TypeVar
- Hydra.Overlay.Haskell.Libraries: _c :: TypeVar
- Hydra.Overlay.Haskell.Libraries: _d :: TypeVar
- Hydra.Overlay.Haskell.Libraries: _k :: TypeVar
- Hydra.Overlay.Haskell.Libraries: _k1 :: TypeVar
- Hydra.Overlay.Haskell.Libraries: _k1Ord :: TypeVar
- Hydra.Overlay.Haskell.Libraries: _k2 :: TypeVar
- Hydra.Overlay.Haskell.Libraries: _k2Ord :: TypeVar
- Hydra.Overlay.Haskell.Libraries: _kOrd :: TypeVar
- Hydra.Overlay.Haskell.Libraries: _s :: TypeVar
- Hydra.Overlay.Haskell.Libraries: _v :: TypeVar
- Hydra.Overlay.Haskell.Libraries: _v1 :: TypeVar
- Hydra.Overlay.Haskell.Libraries: _v2 :: TypeVar
- Hydra.Overlay.Haskell.Libraries: _w :: TypeVar
- Hydra.Overlay.Haskell.Libraries: _x :: TypeVar
- Hydra.Overlay.Haskell.Libraries: _xEq :: TypeVar
- Hydra.Overlay.Haskell.Libraries: _xOrd :: TypeVar
- Hydra.Overlay.Haskell.Libraries: _y :: TypeVar
- Hydra.Overlay.Haskell.Libraries: _yOrd :: TypeVar
- Hydra.Overlay.Haskell.Libraries: _z :: TypeVar
+ Hydra.Classes: numeric :: TypeClass
+ Hydra.Dsl.Lib.Literals: base64ToBinary :: TypedTerm String -> TypedTerm ByteString
+ Hydra.Dsl.Lib.Literals: binaryToBase64 :: TypedTerm ByteString -> TypedTerm String
+ Hydra.Dsl.Lib.Literals: parseBoolean :: TypedTerm String -> TypedTerm (Maybe Bool)
+ Hydra.Dsl.Lib.Literals: parseString :: TypedTerm String -> TypedTerm (Maybe String)
+ Hydra.Dsl.Lib.Literals: printBoolean :: TypedTerm Bool -> TypedTerm String
+ Hydra.Dsl.Lib.Literals: printString :: TypedTerm String -> TypedTerm String
+ Hydra.Dsl.Lib.Math: div :: TypedTerm Int -> TypedTerm Int -> TypedTerm (Maybe Int)
+ Hydra.Dsl.Lib.Math: mod :: TypedTerm Int -> TypedTerm Int -> TypedTerm (Maybe Int)
+ Hydra.Dsl.Lib.Math: rem :: TypedTerm Int -> TypedTerm Int -> TypedTerm (Maybe Int)
+ Hydra.Dsl.Lib.Ordering: compare :: TypedTerm x -> TypedTerm x -> TypedTerm Comparison
+ Hydra.Dsl.Lib.Ordering: gt :: TypedTerm x -> TypedTerm x -> TypedTerm Bool
+ Hydra.Dsl.Lib.Ordering: gte :: TypedTerm x -> TypedTerm x -> TypedTerm Bool
+ Hydra.Dsl.Lib.Ordering: lt :: TypedTerm x -> TypedTerm x -> TypedTerm Bool
+ Hydra.Dsl.Lib.Ordering: lte :: TypedTerm x -> TypedTerm x -> TypedTerm Bool
+ Hydra.Dsl.Lib.Ordering: max :: TypedTerm x -> TypedTerm x -> TypedTerm x
+ Hydra.Dsl.Lib.Ordering: min :: TypedTerm x -> TypedTerm x -> TypedTerm x
+ Hydra.Lib.Literals: base64ToBinary :: PrimitiveDefinition
+ Hydra.Lib.Literals: binaryToBase64 :: PrimitiveDefinition
+ Hydra.Lib.Literals: parseBoolean :: PrimitiveDefinition
+ Hydra.Lib.Literals: parseString :: PrimitiveDefinition
+ Hydra.Lib.Literals: printBoolean :: PrimitiveDefinition
+ Hydra.Lib.Literals: printString :: PrimitiveDefinition
+ Hydra.Lib.Math: div :: PrimitiveDefinition
+ Hydra.Lib.Math: mod :: PrimitiveDefinition
+ Hydra.Lib.Math: rem :: PrimitiveDefinition
+ Hydra.Lib.Ordering: compare :: PrimitiveDefinition
+ Hydra.Lib.Ordering: gt :: PrimitiveDefinition
+ Hydra.Lib.Ordering: gte :: PrimitiveDefinition
+ Hydra.Lib.Ordering: lt :: PrimitiveDefinition
+ Hydra.Lib.Ordering: lte :: PrimitiveDefinition
+ Hydra.Lib.Ordering: max :: PrimitiveDefinition
+ Hydra.Lib.Ordering: min :: PrimitiveDefinition
+ Hydra.Overlay.Haskell.Lib.Literals: base64ToBinary :: String -> ByteString
+ Hydra.Overlay.Haskell.Lib.Literals: binaryToBase64 :: ByteString -> String
+ Hydra.Overlay.Haskell.Lib.Literals: parseBoolean :: String -> Maybe Bool
+ Hydra.Overlay.Haskell.Lib.Literals: parseString :: String -> Maybe String
+ Hydra.Overlay.Haskell.Lib.Literals: printBoolean :: Bool -> String
+ Hydra.Overlay.Haskell.Lib.Literals: printString :: String -> String
+ Hydra.Overlay.Haskell.Lib.Math: addTerm :: Term -> Term -> Term
+ Hydra.Overlay.Haskell.Lib.Math: div :: Int -> Int -> Maybe Int
+ Hydra.Overlay.Haskell.Lib.Math: floatBinary :: String -> (forall a. Num a => a -> a -> a) -> FloatValue -> FloatValue -> FloatValue
+ Hydra.Overlay.Haskell.Lib.Math: floatUnary :: (forall a. Num a => a -> a) -> FloatValue -> FloatValue
+ Hydra.Overlay.Haskell.Lib.Math: integerBinary :: String -> (forall a. Num a => a -> a -> a) -> IntegerValue -> IntegerValue -> IntegerValue
+ Hydra.Overlay.Haskell.Lib.Math: integerUnary :: (forall a. Num a => a -> a) -> IntegerValue -> IntegerValue
+ Hydra.Overlay.Haskell.Lib.Math: mod :: Int -> Int -> Maybe Int
+ Hydra.Overlay.Haskell.Lib.Math: mulTerm :: Term -> Term -> Term
+ Hydra.Overlay.Haskell.Lib.Math: negateTerm :: Term -> Term
+ Hydra.Overlay.Haskell.Lib.Math: numericBinary :: String -> (forall a. Num a => a -> a -> a) -> Term -> Term -> Term
+ Hydra.Overlay.Haskell.Lib.Math: numericLiteral :: String -> Term -> Literal
+ Hydra.Overlay.Haskell.Lib.Math: numericUnary :: String -> (forall a. Num a => a -> a) -> Term -> Term
+ Hydra.Overlay.Haskell.Lib.Math: rem :: Int -> Int -> Maybe Int
+ Hydra.Overlay.Haskell.Lib.Math: subTerm :: Term -> Term -> Term
+ Hydra.Overlay.Haskell.Lib.Ordering: compare :: Ord a => a -> a -> Comparison
+ Hydra.Overlay.Haskell.Lib.Ordering: gt :: Ord a => a -> a -> Bool
+ Hydra.Overlay.Haskell.Lib.Ordering: gte :: Ord a => a -> a -> Bool
+ Hydra.Overlay.Haskell.Lib.Ordering: lt :: Ord a => a -> a -> Bool
+ Hydra.Overlay.Haskell.Lib.Ordering: lte :: Ord a => a -> a -> Bool
+ Hydra.Overlay.Haskell.Lib.Ordering: max :: Ord a => a -> a -> a
+ Hydra.Overlay.Haskell.Lib.Ordering: min :: Ord a => a -> a -> a
+ Hydra.Overlay.Haskell.Libraries: hydraLibOrdering :: Library
- Hydra.Dsl.Lib.Math: add :: TypedTerm Int -> TypedTerm Int -> TypedTerm Int
+ Hydra.Dsl.Lib.Math: add :: TypedTerm x -> TypedTerm x -> TypedTerm x
- Hydra.Dsl.Lib.Math: mul :: TypedTerm Int -> TypedTerm Int -> TypedTerm Int
+ Hydra.Dsl.Lib.Math: mul :: TypedTerm x -> TypedTerm x -> TypedTerm x
- Hydra.Dsl.Lib.Math: negate :: TypedTerm Int -> TypedTerm Int
+ Hydra.Dsl.Lib.Math: negate :: TypedTerm x -> TypedTerm x
- Hydra.Dsl.Lib.Math: sub :: TypedTerm Int -> TypedTerm Int -> TypedTerm Int
+ Hydra.Dsl.Lib.Math: sub :: TypedTerm x -> TypedTerm x -> TypedTerm x
- Hydra.Overlay.Haskell.Dsl.Prims: prim0 :: ToPrimName n => n -> x -> [TypeVar] -> TermCoder x -> Primitive
+ Hydra.Overlay.Haskell.Dsl.Prims: prim0 :: PrimitiveDefinition -> x -> TermCoder x -> Primitive
- Hydra.Overlay.Haskell.Dsl.Prims: prim1 :: ToPrimName n => n -> (x -> y) -> [TypeVar] -> TermCoder x -> TermCoder y -> Primitive
+ Hydra.Overlay.Haskell.Dsl.Prims: prim1 :: PrimitiveDefinition -> (x -> y) -> TermCoder x -> TermCoder y -> Primitive
- Hydra.Overlay.Haskell.Dsl.Prims: prim2 :: ToPrimName n => n -> (x -> y -> z) -> [TypeVar] -> TermCoder x -> TermCoder y -> TermCoder z -> Primitive
+ Hydra.Overlay.Haskell.Dsl.Prims: prim2 :: PrimitiveDefinition -> (x -> y -> z) -> TermCoder x -> TermCoder y -> TermCoder z -> Primitive
- Hydra.Overlay.Haskell.Dsl.Prims: prim3 :: ToPrimName n => n -> (w -> x -> y -> z) -> [TypeVar] -> TermCoder w -> TermCoder x -> TermCoder y -> TermCoder z -> Primitive
+ Hydra.Overlay.Haskell.Dsl.Prims: prim3 :: PrimitiveDefinition -> (w -> x -> y -> z) -> TermCoder w -> TermCoder x -> TermCoder y -> TermCoder z -> Primitive
Files
- hydra-kernel.cabal +4/−1
- src/main/haskell/Hydra/Adapt.hs +13/−12
- src/main/haskell/Hydra/Analysis.hs +6/−6
- src/main/haskell/Hydra/Annotations.hs +2/−2
- src/main/haskell/Hydra/Checking.hs +11/−10
- src/main/haskell/Hydra/Classes.hs +6/−0
- src/main/haskell/Hydra/Codegen.hs +40/−39
- src/main/haskell/Hydra/Decode/Ast.hs +4/−4
- src/main/haskell/Hydra/Decode/Coders.hs +3/−3
- src/main/haskell/Hydra/Decode/Core.hs +9/−9
- src/main/haskell/Hydra/Decode/Docs.hs +1/−1
- src/main/haskell/Hydra/Decode/Error/Checking.hs +1/−1
- src/main/haskell/Hydra/Decode/Error/Core.hs +3/−3
- src/main/haskell/Hydra/Decode/Error/File.hs +1/−1
- src/main/haskell/Hydra/Decode/Error/Packaging.hs +2/−2
- src/main/haskell/Hydra/Decode/Error/System.hs +1/−1
- src/main/haskell/Hydra/Decode/Errors.hs +4/−4
- src/main/haskell/Hydra/Decode/File.hs +1/−1
- src/main/haskell/Hydra/Decode/Json/Model.hs +1/−1
- src/main/haskell/Hydra/Decode/Packaging.hs +5/−5
- src/main/haskell/Hydra/Decode/Parsing.hs +1/−1
- src/main/haskell/Hydra/Decode/Paths.hs +2/−2
- src/main/haskell/Hydra/Decode/Query.hs +6/−6
- src/main/haskell/Hydra/Decode/Regex.hs +3/−3
- src/main/haskell/Hydra/Decode/Util.hs +3/−3
- src/main/haskell/Hydra/Decode/Variants.hs +3/−3
- src/main/haskell/Hydra/Decode/Yaml/Model.hs +2/−2
- src/main/haskell/Hydra/Decoding.hs +32/−32
- src/main/haskell/Hydra/Dependencies.hs +10/−9
- src/main/haskell/Hydra/Dsl/Lib/Chars.hs +16/−16
- src/main/haskell/Hydra/Dsl/Lib/Eithers.hs +46/−82
- src/main/haskell/Hydra/Dsl/Lib/Equality.hs +6/−76
- src/main/haskell/Hydra/Dsl/Lib/Functions.hs +13/−13
- src/main/haskell/Hydra/Dsl/Lib/Lists.hs +119/−190
- src/main/haskell/Hydra/Dsl/Lib/Literals.hs +140/−140
- src/main/haskell/Hydra/Dsl/Lib/Logic.hs +12/−12
- src/main/haskell/Hydra/Dsl/Lib/Maps.hs +63/−63
- src/main/haskell/Hydra/Dsl/Lib/Math.hs +103/−135
- src/main/haskell/Hydra/Dsl/Lib/Optionals.hs +43/−59
- src/main/haskell/Hydra/Dsl/Lib/Ordering.hs +128/−0
- src/main/haskell/Hydra/Dsl/Lib/Pairs.hs +8/−8
- src/main/haskell/Hydra/Dsl/Lib/Regex.hs +20/−20
- src/main/haskell/Hydra/Dsl/Lib/Sets.hs +36/−36
- src/main/haskell/Hydra/Dsl/Lib/Strings.hs +30/−64
- src/main/haskell/Hydra/Dsls.hs +24/−24
- src/main/haskell/Hydra/Encoding.hs +7/−7
- src/main/haskell/Hydra/Environment.hs +2/−2
- src/main/haskell/Hydra/Extract/Core.hs +12/−12
- src/main/haskell/Hydra/Extract/Json.hs +5/−5
- src/main/haskell/Hydra/Formatting.hs +20/−19
- src/main/haskell/Hydra/Hoisting.hs +12/−11
- src/main/haskell/Hydra/Inference.hs +23/−23
- src/main/haskell/Hydra/Json/Decode.hs +18/−18
- src/main/haskell/Hydra/Json/Decoding.hs +1/−1
- src/main/haskell/Hydra/Json/Encode.hs +7/−7
- src/main/haskell/Hydra/Json/Parser.hs +8/−6
- src/main/haskell/Hydra/Json/Writer.hs +10/−9
- src/main/haskell/Hydra/Lexical.hs +7/−6
- src/main/haskell/Hydra/Lib/Chars.hs +16/−16
- src/main/haskell/Hydra/Lib/Defaults.hs +4/−224
- src/main/haskell/Hydra/Lib/Effects.hs +39/−85
- src/main/haskell/Hydra/Lib/Eithers.hs +60/−345
- src/main/haskell/Hydra/Lib/Equality.hs +8/−325
- src/main/haskell/Hydra/Lib/Files.hs +36/−36
- src/main/haskell/Hydra/Lib/Functions.hs +18/−18
- src/main/haskell/Hydra/Lib/Hashing.hs +4/−4
- src/main/haskell/Hydra/Lib/Lists.hs +152/−454
- src/main/haskell/Hydra/Lib/Literals.hs +234/−235
- src/main/haskell/Hydra/Lib/Logic.hs +16/−16
- src/main/haskell/Hydra/Lib/Maps.hs +83/−83
- src/main/haskell/Hydra/Lib/Math.hs +208/−303
- src/main/haskell/Hydra/Lib/Optionals.hs +57/−165
- src/main/haskell/Hydra/Lib/Ordering.hs +329/−0
- src/main/haskell/Hydra/Lib/Pairs.hs +10/−10
- src/main/haskell/Hydra/Lib/Regex.hs +28/−28
- src/main/haskell/Hydra/Lib/Sets.hs +44/−44
- src/main/haskell/Hydra/Lib/Strings.hs +34/−157
- src/main/haskell/Hydra/Lib/System.hs +10/−10
- src/main/haskell/Hydra/Lib/Text.hs +4/−4
- src/main/haskell/Hydra/Names.hs +16/−16
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Prims.hs +19/−77
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Typed/Phantoms.hs +1/−1
- src/main/haskell/Hydra/Overlay/Haskell/Dsl/Typed/Testing.hs +18/−18
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Eithers.hs +2/−18
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Equality.hs +0/−39
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Lists.hs +0/−42
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Literals.hs +12/−12
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Math.hs +100/−29
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Optionals.hs +2/−10
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Ordering.hs +37/−0
- src/main/haskell/Hydra/Overlay/Haskell/Lib/Strings.hs +3/−21
- src/main/haskell/Hydra/Overlay/Haskell/Libraries.hs +283/−316
- src/main/haskell/Hydra/Parse/Docs.hs +6/−6
- src/main/haskell/Hydra/Parse/Regex.hs +3/−2
- src/main/haskell/Hydra/Parsers.hs +2/−2
- src/main/haskell/Hydra/Predicates.hs +6/−4
- src/main/haskell/Hydra/Print/Core.hs +76/−76
- src/main/haskell/Hydra/Print/Docs.hs +8/−8
- src/main/haskell/Hydra/Print/Emacs/Regex.hs +12/−12
- src/main/haskell/Hydra/Print/Error/Core.hs +35/−35
- src/main/haskell/Hydra/Print/Error/Packaging.hs +13/−13
- src/main/haskell/Hydra/Print/Errors.hs +17/−17
- src/main/haskell/Hydra/Print/Graph.hs +2/−2
- src/main/haskell/Hydra/Print/Paths.hs +4/−4
- src/main/haskell/Hydra/Print/Pcre/Regex.hs +12/−12
- src/main/haskell/Hydra/Print/Posix/Regex.hs +13/−13
- src/main/haskell/Hydra/Print/Regex.hs +12/−12
- src/main/haskell/Hydra/Print/Typing.hs +4/−4
- src/main/haskell/Hydra/Reduction.hs +9/−8
- src/main/haskell/Hydra/Resolution.hs +5/−5
- src/main/haskell/Hydra/Scoping.hs +4/−4
- src/main/haskell/Hydra/Serialization.hs +24/−24
- src/main/haskell/Hydra/Sorting.hs +12/−10
- src/main/haskell/Hydra/Substitution.hs +1/−1
- src/main/haskell/Hydra/Templates.hs +1/−1
- src/main/haskell/Hydra/Test/Transform.hs +3/−3
- src/main/haskell/Hydra/Unification.hs +4/−4
- src/main/haskell/Hydra/Validate/Core.hs +13/−12
- src/main/haskell/Hydra/Validate/Packaging.hs +14/−13
- src/main/haskell/Hydra/Variables.hs +7/−7
hydra-kernel.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: hydra-kernel-version: 0.17.2+version: 0.17.3 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@@ -113,6 +113,7 @@ Hydra.Dsl.Lib.Maps Hydra.Dsl.Lib.Math Hydra.Dsl.Lib.Optionals+ Hydra.Dsl.Lib.Ordering Hydra.Dsl.Lib.Pairs Hydra.Dsl.Lib.Regex Hydra.Dsl.Lib.Sets@@ -219,6 +220,7 @@ Hydra.Lib.Maps Hydra.Lib.Math Hydra.Lib.Optionals+ Hydra.Lib.Ordering Hydra.Lib.Pairs Hydra.Lib.Regex Hydra.Lib.Sets@@ -263,6 +265,7 @@ Hydra.Overlay.Haskell.Lib.Maps Hydra.Overlay.Haskell.Lib.Math Hydra.Overlay.Haskell.Lib.Optionals+ Hydra.Overlay.Haskell.Lib.Ordering Hydra.Overlay.Haskell.Lib.Pairs Hydra.Overlay.Haskell.Lib.Regex Hydra.Overlay.Haskell.Lib.Sets
src/main/haskell/Hydra/Adapt.hs view
@@ -25,6 +25,7 @@ import qualified Hydra.Lexical as Lexical import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers import qualified Hydra.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Overlay.Haskell.Lib.Functions as Functions import qualified Hydra.Overlay.Haskell.Lib.Lists as Lists import qualified Hydra.Overlay.Haskell.Lib.Literals as LibLiterals import qualified Hydra.Overlay.Haskell.Lib.Logic as Logic@@ -174,7 +175,7 @@ adaptLiteral lt l = case l of Core.LiteralBinary v0 -> case lt of- Core.LiteralTypeString -> Core.LiteralString (LibLiterals.binaryToString v0)+ Core.LiteralTypeString -> Core.LiteralString (LibLiterals.binaryToBase64 v0) Core.LiteralBoolean v0 -> case lt of Core.LiteralTypeInteger v1 -> Core.LiteralInteger (Literals.bigintToIntegerValue v1 (Logic.ifElse v0 1 0)) Core.LiteralDecimal v0 -> case lt of@@ -210,7 +211,7 @@ adaptLiteralTypesMap constraints = let tryType = \lt -> Optionals.cases (adaptLiteralType constraints lt) Nothing (\lt2 -> Just (lt, lt2))- in (Maps.fromList (Optionals.cat (Lists.map tryType Reflect.literalTypes)))+ in (Maps.fromList (Optionals.givens (Lists.map tryType Reflect.literalTypes))) -- | Adapt a literal value using the given language constraints adaptLiteralValue :: Ord t0 => (M.Map t0 Core.LiteralType -> t0 -> Core.Literal -> Core.Literal)@@ -277,7 +278,7 @@ Core.typeApplicationTermBody = (Core.typeApplicationTermBody v0), Core.typeApplicationTermType = atyp}))) Core.TermTypeLambda _ -> Right term1- _ -> Eithers.bind (tryTerm term1) (\mterm -> Optionals.cases mterm (Left (Errors.ErrorOther (Errors.OtherError (Strings.cat2 "no alternatives for term: " (PrintCore.term term1))))) (\term2 -> Right term2))))+ _ -> Eithers.bind (tryTerm term1) (\mterm -> Optionals.cases mterm (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat2 "no alternatives for term: " (PrintCore.term term1))))) (\term2 -> Right term2)))) in (Rewriting.rewriteTermM rewrite term0) -- | Adapt a term using the constraints of a given language@@ -323,7 +324,7 @@ let supportedVariant = Sets.member (Reflect.typeVariant typ) (Coders.languageConstraintsTypeVariants constraints) in (Logic.ifElse supportedVariant (forSupported typ) (forUnsupported typ)) rewrite =- \recurse -> \typ -> Eithers.bind (recurse typ) (\type1 -> Optionals.cases (tryType type1) (Left (Errors.ErrorOther (Errors.OtherError (Strings.cat2 "no alternatives for type: " (PrintCore.type_ typ))))) (\type2 -> Right type2))+ \recurse -> \typ -> Eithers.bind (recurse typ) (\type1 -> Optionals.cases (tryType type1) (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat2 "no alternatives for type: " (PrintCore.type_ typ))))) (\type2 -> Right type2)) in (Rewriting.rewriteTypeM rewrite type0) -- | Adapt a type using the constraints of a given language@@ -388,7 +389,7 @@ qualifyUntyped = \b -> let nm = Core.unName (Core.bindingName b)- in (Optionals.cases (Names.moduleNameOf (Core.bindingName b)) (Strings.cat2 "(no module) " nm) (\ns -> Strings.cat [+ in (Optionals.cases (Names.moduleNameOf (Core.bindingName b)) (Strings.concat2 "(no module) " nm) (\ns -> Strings.concat [ Packaging.unModuleName ns, " :: ", nm]))@@ -396,7 +397,7 @@ \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.cat [+ in (Logic.ifElse (Lists.null untypedBindings) (Right bindings) (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat [ "Found ", (LibLiterals.showInt32 (Lists.length untypedBindings)), " untyped binding(s) (",@@ -404,7 +405,7 @@ "); each must carry a type scheme at this stage. ", "This usually means stale dist/json field shapes after a kernel record rename ", "(regenerate the affected package's JSON). Offending bindings (module :: name): ",- (Strings.intercalate ", " untypedBindings)])))))+ (Strings.join ", " untypedBindings)]))))) normalizeBindings = \bindings -> Lists.map (\b -> Core.Binding { Core.bindingName = (Core.bindingName b),@@ -445,7 +446,7 @@ t3 = peelOne t2 in (Optionals.cases (extractAnn t) (Optionals.cases (extractAnn t1) (Optionals.cases (extractAnn t2) (extractAnn t3) (\a -> Just a)) (\a -> Just a)) (\a -> Just a)) originalAnnotations =- Maps.fromList (Optionals.cat (Lists.map (\b -> Optionals.cases (findAnn (Core.bindingTerm b)) Nothing (\ann -> Just (Core.bindingName b, ann))) originalBindings))+ Maps.fromList (Optionals.givens (Lists.map (\b -> Optionals.cases (findAnn (Core.bindingTerm b)) Nothing (\ann -> Just (Core.bindingName b, ann))) originalBindings)) reattachAnnotation = \b -> Optionals.cases (Maps.lookup (Core.bindingName b) originalAnnotations) b (\ann -> Core.Binding { Core.bindingName = (Core.bindingName b),@@ -468,13 +469,13 @@ Lists.filter (\el -> Optionals.cases (Names.moduleNameOf (Core.bindingName el)) False (\ns -> Sets.member ns namespacesSet)) bins5 elementsByNamespace = Lists.foldl (\acc -> \el -> Optionals.cases (Names.moduleNameOf (Core.bindingName el)) acc (\ns ->- let existing = Optionals.cases (Maps.lookup ns acc) [] Equality.identity+ let existing = Optionals.cases (Maps.lookup ns acc) [] Functions.identity in (Maps.insert ns (Lists.concat2 existing [ el]) acc))) Maps.empty selectedElements defsGrouped = Lists.map (\ns ->- let elsForNs = Optionals.cases (Maps.lookup ns elementsByNamespace) [] Equality.identity- in (Optionals.cat (Lists.map toDef elsForNs))) namespaces+ let elsForNs = Optionals.cases (Maps.lookup ns elementsByNamespace) [] Functions.identity+ in (Optionals.givens (Lists.map toDef elsForNs))) namespaces g = Lexical.buildGraph bins5 Maps.empty (Graph.graphPrimitives adapted) in (Right ( Graph.Graph {@@ -564,7 +565,7 @@ Core.LiteralTypeString, ( (\v -> case v of- Core.LiteralBinary v1 -> Core.LiteralString (LibLiterals.binaryToString v1)+ Core.LiteralBinary v1 -> Core.LiteralString (LibLiterals.binaryToBase64 v1) _ -> v), (Sets.fromList [ "replace binary strings with character strings"])))
src/main/haskell/Hydra/Analysis.hs view
@@ -63,7 +63,7 @@ addNamesToModuleNames :: (Packaging.ModuleName -> t0) -> S.Set Core.Name -> Util.ModuleNames t0 -> Util.ModuleNames t0 addNamesToModuleNames encodeModuleName names ns0 = - let nss = Sets.fromList (Optionals.cat (Lists.map Names.moduleNameOf (Sets.toList names)))+ let nss = Sets.fromList (Optionals.givens (Lists.map Names.moduleNameOf (Sets.toList names))) toPair = \ns -> (ns, (encodeModuleName ns)) in Util.ModuleNames { Util.moduleNamesFocus = (Util.moduleNamesFocus ns0),@@ -133,7 +133,7 @@ Packaging.DefinitionTerm v0 -> Dependencies.termDependencyNames True True True (Packaging.termDefinitionBody v0) Packaging.DefinitionPrimitive v0 -> Dependencies.typeDependencyNames True (Core.typeSchemeBody (Scoping.termSignatureToTypeScheme (Packaging.primitiveDefinitionSignature v0))) allNames = Sets.unions (Lists.map defNames defs)- in (Sets.fromList (Optionals.cat (Lists.map Names.moduleNameOf (Sets.toList allNames))))+ in (Sets.fromList (Optionals.givens (Lists.map Names.moduleNameOf (Sets.toList allNames)))) -- | Find dependency module names in all of a set of terms (Either version) dependencyModuleNames :: t0 -> Graph.Graph -> Bool -> Bool -> Bool -> Bool -> [Core.Binding] -> Either Errors.Error (S.Set Packaging.ModuleName)@@ -155,7 +155,7 @@ (Dependencies.termDependencyNames binds withPrims withNoms decodedTerm)]) (Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\_a -> _a) (DecodeCore.term graph term))) (Right (Sets.unions [ dataNames, schemaNames]))))- in (Eithers.map (\namesList -> Sets.fromList (Optionals.cat (Lists.map Names.moduleNameOf (Sets.toList (Sets.unions namesList))))) (Eithers.mapList depNames els))+ in (Eithers.map (\namesList -> Sets.fromList (Optionals.givens (Lists.map Names.moduleNameOf (Sets.toList (Sets.unions namesList))))) (Eithers.mapList depNames els)) -- | Gather applications from a term, returning (args, baseTerm) gatherApplications :: Core.Term -> ([Core.Term], Core.Term)@@ -274,7 +274,7 @@ _ -> False) termContainsBinary = \term -> Rewriting.foldOverTerm Coders.TraversalOrderPre checkTerm False term defTerms =- Optionals.cat (Lists.map (\d -> case d of+ Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionTerm v0 -> Just (Packaging.termDefinitionBody v0) _ -> Nothing) (Packaging.moduleDefinitions mod)) in (Lists.foldl (\acc -> \t -> Logic.or acc (termContainsBinary t)) False defTerms)@@ -291,7 +291,7 @@ _ -> False) termContainsDecimal = \term -> Rewriting.foldOverTerm Coders.TraversalOrderPre checkTerm False term defTerms =- Optionals.cat (Lists.map (\d -> case d of+ Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionTerm v0 -> Just (Packaging.termDefinitionBody v0) _ -> Nothing) (Packaging.moduleDefinitions mod)) in (Lists.foldl (\acc -> \t -> Logic.or acc (termContainsDecimal t)) False defTerms)@@ -301,7 +301,7 @@ moduleDependencyModuleNames cx graph binds withPrims withNoms withSchema mod = let allBindings =- Optionals.cat (Lists.map (\d -> case d of+ Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionType v0 -> Just ((\name -> \typ -> let schemaTerm = Core.TermVariable (Core.Name "hydra.core.Type") dataTerm =
src/main/haskell/Hydra/Annotations.hs view
@@ -89,7 +89,7 @@ v = Pairs.second p in (Optionals.map (\n -> (n, v)) (extractName k)) in case t of- Core.TermMap v0 -> Maps.fromList (Optionals.cat (Lists.map fromEntry (Maps.toList v0)))+ Core.TermMap v0 -> Maps.fromList (Optionals.givens (Lists.map fromEntry (Maps.toList v0))) _ -> Maps.empty -- | Get description from annotations map (Either version)@@ -145,7 +145,7 @@ isNativeType el = let isFlaggedAsFirstClassType =- Optionals.fromOptional False (Optionals.map (\_ -> True) (getTermAnnotation Constants.keyFirstClassType (Core.bindingTerm el)))+ Optionals.withDefault False (Optionals.map (\_ -> True) (getTermAnnotation Constants.keyFirstClassType (Core.bindingTerm el))) in (Optionals.cases (Core.bindingTypeScheme el) False (\ts -> Logic.and (Equality.equal ts (Core.TypeScheme { Core.typeSchemeVariables = [], Core.typeSchemeBody = (Core.TypeVariable (Core.Name "hydra.core.Type")),
src/main/haskell/Hydra/Checking.hs view
@@ -85,7 +85,7 @@ in (applyTypeArgumentsToType cx tx at (Substitution.substInType (Typing.TypeSubst (Maps.singleton v ah)) tbody)) Core.TypeVariable v0 -> Eithers.either (\_ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError { Errors.unexpectedShapeErrorExpected = "forall type",- Errors.unexpectedShapeErrorActual = (Strings.cat [+ Errors.unexpectedShapeErrorActual = (Strings.concat [ PrintCore.type_ t, ". Trying to apply ", (Literals.showInt32 (Lists.length typeArgs)),@@ -98,14 +98,14 @@ _ -> Right t) (Resolution.requireSchemaType cx (Graph.graphSchemaTypes tx) v0) _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError { Errors.unexpectedShapeErrorExpected = "forall type",- Errors.unexpectedShapeErrorActual = (Strings.cat [+ Errors.unexpectedShapeErrorActual = (Strings.concat [ PrintCore.type_ t, ". Trying to apply ", (Literals.showInt32 (Lists.length typeArgs)), " type args: ", (Formatting.showList PrintCore.type_ typeArgs), ". Context has vars: {",- (Strings.intercalate ", " (Lists.map Core.unName (Maps.keys (Graph.graphBoundTypes tx)))),+ (Strings.join ", " (Lists.map Core.unName (Maps.keys (Graph.graphBoundTypes tx)))), "}"])})))) -- | Check that a term has no unbound type variables (Either version). Paper: inference.tex, 'Checking the witness' (always-on finalization invariant).@@ -150,7 +150,7 @@ Left (Errors.ErrorChecking (Checking.CheckingErrorUnequalTypes (Checking.UnequalTypesError { Checking.unequalTypesErrorTypes = types, Checking.unequalTypesErrorDescription = desc})))- in (Logic.ifElse (typesAllEffectivelyEqual tx types) (Optionals.cases (Lists.maybeHead types) unequalErr (\t -> Right t)) unequalErr)+ in (Logic.ifElse (typesAllEffectivelyEqual tx types) (Optionals.cases (Lists.head types) unequalErr (\t -> Right t)) unequalErr) -- | Sanity-check a type substitution arising from unification. Specifically, check that schema types have not been inappropriately unified with type variables inferred from terms. Paper: inference.tex, 'Checking the witness' (always-on invariant: a substitution may not bind a type name as if it were an inference variable). checkTypeSubst :: t0 -> Graph.Graph -> Typing.TypeSubst -> Either Errors.Error Typing.TypeSubst@@ -168,7 +168,8 @@ badVars = Sets.fromList (Lists.filter (\v -> Optionals.cases (Lexical.dereferenceSchemaType v (Graph.graphSchemaTypes tx)) False isNominal) (Sets.toList suspectVars)) badPairs = Lists.filter (\p -> Sets.member (Pairs.first p) badVars) (Maps.toList s)- printPair = \p -> Strings.cat2 (Strings.cat2 (Core.unName (Pairs.first p)) " --> ") (PrintCore.type_ (Pairs.second p))+ 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 { Checking.incorrectUnificationErrorSubstitution = subst}))))) @@ -186,7 +187,7 @@ let collectVars = \acc -> \t -> case t of- Core.TypeVariable v0 -> Logic.ifElse (Maps.member v0 acc) acc (Maps.insert v0 (Core.Name (Strings.cat2 "_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.showInt32 (Maps.size acc)))) acc) _ -> acc subst = Rewriting.foldOverType Coders.TraversalOrderPre collectVars Maps.empty typ in (Variables.substituteTypeVariables subst typ)@@ -295,7 +296,7 @@ in (Eithers.bind (ExtractCore.functionType t) (\ft -> Right (Lists.concat2 cods (Lists.pure (Core.functionTypeCodomain ft)), cx3))))) (Right ([], cx3)) tcterms in (Eithers.bind fcodsResult (\fcodsR -> let fcods = Pairs.first fcodsR- cods = Optionals.cat (Lists.cons tdflt (Lists.map Optionals.pure fcods))+ cods = Optionals.givens (Lists.cons tdflt (Lists.map Optionals.pure fcods)) in (Eithers.bind (checkSameType cx3 tx "case branches" cods) (\cod -> Right ( Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Resolution.nominalApplication tname typeArgs),@@ -421,7 +422,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.cases (Lists.maybeHead typeArgs) listArityErr (\ta0 -> Right (Core.TypeList ta0, cx))) listArityErr) (+ in (Logic.ifElse (Lists.null els) (Logic.ifElse (Equality.equal (Lists.length typeArgs) 1) (Optionals.cases (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@@ -504,7 +505,7 @@ Checking.typeArityMismatchErrorExpectedArity = 1, Checking.typeArityMismatchErrorActualArity = n, Checking.typeArityMismatchErrorTypeArguments = typeArgs})))- in (Logic.ifElse (Equality.equal n 1) (Optionals.cases (Lists.maybeHead typeArgs) maybeArityErr (\ta0 -> Right (Core.TypeOptional ta0, cx))) maybeArityErr)+ in (Logic.ifElse (Equality.equal n 1) (Optionals.cases (Lists.head typeArgs) maybeArityErr (\ta0 -> Right (Core.TypeOptional ta0, cx))) maybeArityErr) forJust = \term -> Eithers.bind (typeOf cx tx [] term) (\tResult -> let termType = Pairs.first tResult@@ -602,7 +603,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.cases (Lists.maybeHead typeArgs) setArityErr (\ta0 -> Right (Core.TypeSet ta0, cx))) setArityErr) (+ in (Logic.ifElse (Sets.null els) (Logic.ifElse (Equality.equal (Lists.length typeArgs) 1) (Optionals.cases (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
src/main/haskell/Hydra/Classes.hs view
@@ -41,6 +41,12 @@ equality = Typing.TypeClass { Typing.typeClassDescription = "Equality: instances support structural equality."} +-- | The numeric type class: instances support arithmetic (addition, subtraction, multiplication, negation).+numeric :: Typing.TypeClass+numeric =+ Typing.TypeClass {+ Typing.typeClassDescription = "Numeric: instances support arithmetic (addition, subtraction, multiplication, negation)."}+ -- | The ordering type class: instances support total ordering (and equality). ordering :: Typing.TypeClass ordering =
src/main/haskell/Hydra/Codegen.hs view
@@ -39,6 +39,7 @@ 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+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@@ -85,20 +86,20 @@ escapeControlCharsInJson :: [Int] -> [Int] escapeControlCharsInJson input = - let hexDigit = \n -> Logic.ifElse (Equality.lt n 10) (Math.add 48 n) (Math.add 97 (Math.sub n 10))+ let hexDigit = \n -> Logic.ifElse (Ordering.lt n 10) (Math.add 48 n) (Math.add 97 (Math.sub n 10)) escapeToUnicode = \b -> [ 92, 117, 48, 48,- (hexDigit (Optionals.fromOptional 0 (Math.maybeDiv b 16))),- (hexDigit (Optionals.fromOptional 0 (Math.maybeMod b 16)))]+ (hexDigit (Optionals.withDefault 0 (Math.div b 16))),+ (hexDigit (Optionals.withDefault 0 (Math.mod b 16)))] go = \inStr -> \esc -> \bytes -> Optionals.cases (Lists.uncons bytes) [] (\uc -> let b = Pairs.first uc bs = Pairs.second uc- in (Logic.ifElse esc (Lists.cons b (go inStr False bs)) (Logic.ifElse (Logic.and (Equality.equal b 92) inStr) (Lists.cons b (go inStr True bs)) (Logic.ifElse (Equality.equal b 34) (Lists.cons b (go (Logic.not inStr) False bs)) (Logic.ifElse (Logic.and inStr (Equality.lt b 32)) (Lists.concat2 (escapeToUnicode b) (go inStr False bs)) (Lists.cons b (go inStr False bs)))))))+ in (Logic.ifElse esc (Lists.cons b (go inStr False bs)) (Logic.ifElse (Logic.and (Equality.equal b 92) inStr) (Lists.cons b (go inStr True bs)) (Logic.ifElse (Equality.equal b 34) (Lists.cons b (go (Logic.not inStr) False bs)) (Logic.ifElse (Logic.and inStr (Ordering.lt b 32)) (Lists.concat2 (escapeToUnicode b) (go inStr False bs)) (Lists.cons b (go inStr False bs))))))) in (go False False input) -- | Format a primitive for the lexicon@@ -108,7 +109,7 @@ let name = Core.unName (Packaging.primitiveDefinitionName (Graph.primitiveDefinition prim)) typ = Scoping.termSignatureToTypeScheme (Packaging.primitiveDefinitionSignature (Graph.primitiveDefinition prim)) typeStr = PrintCore.typeScheme typ- in (Strings.cat2 (Strings.cat2 (Strings.cat2 " " name) " : ") typeStr)+ in (Strings.concat2 (Strings.concat2 (Strings.concat2 " " name) " : ") typeStr) -- | Format a term binding for the lexicon formatTermBinding :: Core.Binding -> String@@ -116,12 +117,12 @@ let name = Core.unName (Core.bindingName binding) typeStr = Optionals.cases (Core.bindingTypeScheme binding) "?" (\scheme -> PrintCore.typeScheme scheme)- in (Strings.cat2 (Strings.cat2 (Strings.cat2 " " name) " : ") typeStr)+ in (Strings.concat2 (Strings.concat2 (Strings.concat2 " " name) " : ") typeStr) -- | Format a type binding for the lexicon formatTypeBinding :: Graph.Graph -> Core.Binding -> Either Errors.Error String formatTypeBinding graph binding =- Eithers.bind (Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\_a -> _a) (DecodeCore.type_ graph (Core.bindingTerm binding))) (\typ -> Right (Strings.cat2 (Strings.cat2 (Strings.cat2 " " (Core.unName (Core.bindingName binding))) " = ") (PrintCore.type_ typ)))+ Eithers.bind (Eithers.bimap (\_e -> Errors.ErrorDecoding _e) (\_a -> _a) (DecodeCore.type_ graph (Core.bindingTerm binding))) (\typ -> Right (Strings.concat2 (Strings.concat2 (Strings.concat2 " " (Core.unName (Core.bindingName binding))) " = ") (PrintCore.type_ typ))) -- | Generate encoder or decoder modules for a list of type modules generateCoderModules :: (t0 -> Graph.Graph -> t1 -> Either t2 (Maybe t3)) -> Graph.Graph -> [Packaging.Module] -> [t1] -> t0 -> Either t2 [t3]@@ -130,7 +131,7 @@ let universe = Maps.fromList (Lists.map (\m -> (Packaging.moduleName m, m)) (Lists.concat2 universeModules universeModules)) closureModules = moduleDepsTransitive universe universeModules schemaElements =- Lists.concat (Lists.map (\m -> Optionals.cat (Lists.map (\d -> case d of+ Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionType v0 -> Just ((\name -> \typ -> let schemaTerm = Core.TermVariable (Core.Name "hydra.core.Type") dataTerm =@@ -147,7 +148,7 @@ Core.typeSchemeConstraints = Nothing}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0))) _ -> Nothing) (Packaging.moduleDefinitions m))) closureModules) dataElements =- Lists.concat (Lists.map (\m -> Optionals.cat (Lists.map (\d -> case d of+ Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionTerm v0 -> Just (Core.Binding { Core.bindingName = (Packaging.termDefinitionName v0), Core.bindingTerm = (Packaging.termDefinitionBody v0),@@ -157,7 +158,7 @@ schemaTypes = Eithers.either (\_ -> Maps.empty) (\_r -> _r) (Environment.schemaGraphToTypingEnvironment schemaGraph) allElements = Lists.concat2 schemaElements dataElements graph = Lexical.elementsToGraph bsGraph schemaTypes allElements- in (Eithers.map (\results -> Optionals.cat results) (Eithers.mapList (\m -> codec cx graph m) typeModules))+ in (Eithers.map (\results -> Optionals.givens results) (Eithers.mapList (\m -> codec cx graph m) typeModules)) -- | Generate the lexicon content from a graph generateLexicon :: Graph.Graph -> Either Errors.Error String@@ -168,13 +169,13 @@ partitioned = Lists.partition (\b -> Annotations.isNativeType b) bindings typeBindings = Pairs.first partitioned termBindings = Pairs.second partitioned- sortedPrimitives = Lists.sortOn (\p -> Packaging.primitiveDefinitionName (Graph.primitiveDefinition p)) primitives- sortedTypes = Lists.sortOn (\b -> Core.bindingName b) typeBindings- sortedTerms = Lists.sortOn (\b -> Core.bindingName b) termBindings+ sortedPrimitives = Lists.sortBy (\p -> Packaging.primitiveDefinitionName (Graph.primitiveDefinition p)) primitives+ sortedTypes = Lists.sortBy (\b -> Core.bindingName b) typeBindings+ sortedTerms = Lists.sortBy (\b -> Core.bindingName b) termBindings in (Eithers.bind (Eithers.mapList (\b -> formatTypeBinding graph b) sortedTypes) (\typeLines -> let termLines = Lists.map (\b -> formatTermBinding b) sortedTerms primitiveLines = Lists.map (\p -> formatPrimitive p) sortedPrimitives- in (Right (Strings.cat2 (Strings.cat2 (Strings.cat2 (Strings.cat2 (Strings.cat2 "Primitives:\n" (Strings.unlines primitiveLines)) "\nTypes:\n") (Strings.unlines typeLines)) "\nTerms:\n") (Strings.unlines termLines)))))+ in (Right (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 "Primitives:\n" (Strings.unlines primitiveLines)) "\nTypes:\n") (Strings.unlines typeLines)) "\nTerms:\n") (Strings.unlines termLines))))) -- | Pure core of code generation: given a coder, language, infer flag, bootstrap graph, universe, and modules to generate, produce a list of (filePath, content) pairs. Emission flags doExpand/doHoistCaseStatements/doHoistPolymorphicLetBindings are derived from the absence of the matching LanguageFeature in lang.supportedFeatures: a target that lacks partialApplication needs eta expansion (doExpand=true), and so on. generateSourceFiles :: Ord t0 => ((Packaging.Module -> [Packaging.Definition] -> Typing.InferenceContext -> Graph.Graph -> Either Errors.Error (M.Map t0 t1)) -> Coders.Language -> Bool -> Graph.Graph -> [Packaging.Module] -> [Packaging.Module] -> Typing.InferenceContext -> Either Errors.Error [(t0, t1)])@@ -187,7 +188,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.cat (Lists.map (\d -> case d of+ Lists.filter (\mod -> Logic.not (Lists.null (Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionType v0 -> Just ((\name -> \typ -> let schemaTerm = Core.TermVariable (Core.Name "hydra.core.Type") dataTerm =@@ -204,7 +205,7 @@ Core.typeSchemeConstraints = Nothing}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0))) _ -> Nothing) (Packaging.moduleDefinitions mod))))) modsToGenerate termModulesToGenerate =- Lists.filter (\mod -> Logic.not (Lists.null (Optionals.cat (Lists.map (\d -> case d of+ Lists.filter (\mod -> Logic.not (Lists.null (Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionTerm v0 -> Just (Core.Binding { Core.bindingName = (Packaging.termDefinitionName v0), Core.bindingTerm = (Packaging.termDefinitionBody v0),@@ -212,7 +213,7 @@ _ -> Nothing) (Packaging.moduleDefinitions mod))))) modsToGenerate closureMods = moduleDepsTransitive namespaceMap modsToGenerate schemaElements =- Lists.concat (Lists.map (\m -> Optionals.cat (Lists.map (\d -> case d of+ Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionType v0 -> Just ((\name -> \typ -> let schemaTerm = Core.TermVariable (Core.Name "hydra.core.Type") dataTerm =@@ -229,7 +230,7 @@ Core.typeSchemeConstraints = Nothing}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0))) _ -> Nothing) (Packaging.moduleDefinitions m))) closureMods) dataElements =- Lists.concat (Lists.map (\m -> Optionals.cat (Lists.map (\d -> case d of+ Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionTerm v0 -> Just (Core.Binding { Core.bindingName = (Packaging.termDefinitionName v0), Core.bindingTerm = (Packaging.termDefinitionBody v0),@@ -240,7 +241,7 @@ dataGraph = Lexical.elementsToGraph bsGraph schemaTypes2 dataElements in (Eithers.bind (Logic.ifElse (Lists.null typeModulesToGenerate) (Right []) ( let nameLists =- Lists.map (\m -> Optionals.cat (Lists.map (\d -> case d of+ Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionType v0 -> Just (Packaging.typeDefinitionName v0) _ -> Nothing) (Packaging.moduleDefinitions m))) typeModulesToGenerate in (Eithers.bind (Adapt.schemaGraphToDefinitions constraints schemaGraph nameLists cx) (\schemaResult ->@@ -273,7 +274,7 @@ Packaging.moduleName = (Packaging.moduleName m), Packaging.moduleMetadata = (Packaging.moduleMetadata m), Packaging.moduleDependencies = (Packaging.moduleDependencies m),- Packaging.moduleDefinitions = (Optionals.cat (Lists.map (\d -> case d of+ Packaging.moduleDefinitions = (Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionType v0 -> Just (Packaging.DefinitionType v0) Packaging.DefinitionTerm v0 -> Optionals.map (\b -> Packaging.DefinitionTerm (Packaging.TermDefinition { Packaging.termDefinitionName = (Core.bindingName b),@@ -284,7 +285,7 @@ allBindings = Lexical.graphToBindings g1 refreshedMods = Lists.map (\m -> refreshModule allBindings m) termModulesToGenerate dedupDefs =- \defs -> Lists.sortOn (\d -> Packaging.termDefinitionName d) (Maps.elems (Maps.fromList (Lists.map (\d -> (Packaging.termDefinitionName d, d)) defs)))+ \defs -> Lists.sortBy (\d -> Packaging.termDefinitionName d) (Maps.elems (Maps.fromList (Lists.map (\d -> (Packaging.termDefinitionName d, d)) defs))) dedupedDefLists = Lists.map dedupDefs defLists in (Eithers.map (\xs -> Lists.concat xs) (Eithers.mapList (\p -> let mod = Pairs.first p@@ -297,7 +298,7 @@ let g0 = modulesToGraph bsGraph kernelModules kernelModules dataElements =- Lists.concat (Lists.map (\m -> Optionals.cat (Lists.map (\d -> case d of+ Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionTerm v0 -> Just (Core.Binding { Core.bindingName = (Packaging.termDefinitionName v0), Core.bindingTerm = (Packaging.termDefinitionBody v0),@@ -306,7 +307,7 @@ in (Eithers.bind (Inference.inferGraphTypes cx dataElements g0) (\inferResultWithCx -> let g1 = Pairs.first (Pairs.first inferResultWithCx) schemaElements =- Lists.concat (Lists.map (\m -> Optionals.cat (Lists.map (\d -> case d of+ Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionType v0 -> Just ((\name -> \typ -> let schemaTerm = Core.TermVariable (Core.Name "hydra.core.Type") dataTerm =@@ -324,7 +325,7 @@ _ -> Nothing) (Packaging.moduleDefinitions m))) kernelModules) typeBoundTerms = Maps.fromList (Lists.map (\b -> (Core.bindingName b, (Core.bindingTerm b))) schemaElements) typeBoundTypes =- Maps.fromList (Optionals.cat (Lists.map (\b -> Optionals.map (\ts -> (Core.bindingName b, ts)) (Core.bindingTypeScheme b)) schemaElements))+ Maps.fromList (Optionals.givens (Lists.map (\b -> Optionals.map (\ts -> (Core.bindingName b, ts)) (Core.bindingTypeScheme b)) schemaElements)) g2 = Graph.Graph { Graph.graphBoundTerms = (Maps.union typeBoundTerms (Graph.graphBoundTerms g1)),@@ -353,7 +354,7 @@ let g0 = modulesToGraph bsGraph universeMods universeMods dataElements =- Lists.concat (Lists.map (\m -> Optionals.cat (Lists.map (\d -> case d of+ Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionTerm v0 -> Just (Core.Binding { Core.bindingName = (Packaging.termDefinitionName v0), Core.bindingTerm = (Packaging.termDefinitionBody v0),@@ -376,7 +377,7 @@ Lists.concat (Lists.map (\m -> let isTarget = Sets.member (Packaging.moduleName m) targetNamespaces bs =- Optionals.cat (Lists.map (\d -> case d of+ Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionTerm v0 -> Just (Core.Binding { Core.bindingName = (Packaging.termDefinitionName v0), Core.bindingTerm = (Packaging.termDefinitionBody v0),@@ -387,7 +388,7 @@ Lists.concat (Lists.map (\m -> let isTarget = Sets.member (Packaging.moduleName m) targetNamespaces bs =- Optionals.cat (Lists.map (\d -> case d of+ Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionPrimitive v0 -> Optionals.map (\impl -> Core.Binding { Core.bindingName = (Packaging.primitiveDefinitionName v0), Core.bindingTerm = impl,@@ -399,7 +400,7 @@ Lists.concat (Lists.map (\m -> let isTarget = Sets.member (Packaging.moduleName m) targetNamespaces bs =- Optionals.cat (Lists.map (\d -> case d of+ Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionTerm v0 -> Just (Core.Binding { Core.bindingName = (Packaging.termDefinitionName v0), Core.bindingTerm = (Packaging.termDefinitionBody v0),@@ -460,11 +461,11 @@ let closure = Sets.union (transitiveDeps (\m -> Lists.map (\dep -> Packaging.moduleDependencyModule dep) (Packaging.moduleDependencies m)) nsMap modules) (Sets.fromList (Lists.map (\m -> Packaging.moduleName m) modules))- in (Optionals.cat (Lists.map (\n -> Maps.lookup n nsMap) (Sets.toList closure)))+ in (Optionals.givens (Lists.map (\n -> Maps.lookup n nsMap) (Sets.toList closure))) -- | Convert a module name to a file path (e.g., hydra.core -> hydra/core) moduleNameToPath :: Packaging.ModuleName -> String-moduleNameToPath ns = Strings.intercalate "/" (Strings.splitOn "." (Packaging.unModuleName ns))+moduleNameToPath ns = Strings.join "/" (Strings.splitOn "." (Packaging.unModuleName ns)) -- | Convert a Module to a JSON string moduleToJson :: M.Map Core.Name Core.Type -> Packaging.Module -> Either Errors.Error String@@ -479,11 +480,11 @@ moduleToSourceModule m = let sourceNs =- Packaging.ModuleName (Strings.cat2 "hydra.sources." (Strings.intercalate "." (Lists.drop 1 (Strings.splitOn "." (Packaging.unModuleName (Packaging.moduleName m))))))+ Packaging.ModuleName (Strings.concat2 "hydra.sources." (Strings.join "." (Lists.drop 1 (Strings.splitOn "." (Packaging.unModuleName (Packaging.moduleName m)))))) modTypeNs = Packaging.ModuleName "hydra.packaging" moduleDef = Packaging.DefinitionTerm (Packaging.TermDefinition {- Packaging.termDefinitionName = (Core.Name (Strings.cat2 (Packaging.unModuleName sourceNs) ".module_")),+ Packaging.termDefinitionName = (Core.Name (Strings.concat2 (Packaging.unModuleName sourceNs) ".module_")), Packaging.termDefinitionMetadata = Nothing, Packaging.termDefinitionSignature = (Just (Scoping.typeSchemeToTermSignature (Core.TypeScheme { Core.typeSchemeVariables = [],@@ -493,7 +494,7 @@ in Packaging.Module { Packaging.moduleName = sourceNs, Packaging.moduleMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just (Strings.cat2 "Source module for " (Packaging.unModuleName (Packaging.moduleName m)))),+ Packaging.entityMetadataDescription = (Just (Strings.concat2 "Source module for " (Packaging.unModuleName (Packaging.moduleName m)))), Packaging.entityMetadataComments = [], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})),@@ -511,7 +512,7 @@ let universe = Maps.fromList (Lists.map (\m -> (Packaging.moduleName m, m)) (Lists.concat2 universeModules modules)) closureModules = moduleDepsTransitive universe modules schemaElements =- Lists.concat (Lists.map (\m -> Optionals.cat (Lists.map (\d -> case d of+ Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionType v0 -> Just ((\name -> \typ -> let schemaTerm = Core.TermVariable (Core.Name "hydra.core.Type") dataTerm =@@ -528,7 +529,7 @@ Core.typeSchemeConstraints = Nothing}))}) (Packaging.typeDefinitionName v0) (Core.typeSchemeBody (Packaging.typeDefinitionBody v0))) _ -> Nothing) (Packaging.moduleDefinitions m))) closureModules) dataElements =- Lists.concat (Lists.map (\m -> Optionals.cat (Lists.map (\d -> case d of+ Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionTerm v0 -> Just (Core.Binding { Core.bindingName = (Packaging.termDefinitionName v0), Core.bindingTerm = (Packaging.termDefinitionBody v0),@@ -538,14 +539,14 @@ schemaTypes = Eithers.either (\_ -> Maps.empty) (\_r -> _r) (Environment.schemaGraphToTypingEnvironment schemaGraph) baseGraph = Lexical.elementsToGraph bsGraph schemaTypes dataElements universeDataElements =- Lists.concat (Lists.map (\m -> Optionals.cat (Lists.map (\d -> case d of+ Lists.concat (Lists.map (\m -> Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionTerm v0 -> Just (Core.Binding { Core.bindingName = (Packaging.termDefinitionName v0), Core.bindingTerm = (Packaging.termDefinitionBody v0), Core.bindingTypeScheme = (Optionals.map Scoping.termSignatureToTypeScheme (Packaging.termDefinitionSignature v0))}) _ -> Nothing) (Packaging.moduleDefinitions m))) universeModules) universeBoundTypes =- Maps.fromList (Optionals.cat (Lists.map (\b -> Optionals.map (\ts -> (Core.bindingName b, ts)) (Core.bindingTypeScheme b)) universeDataElements))+ Maps.fromList (Optionals.givens (Lists.map (\b -> Optionals.map (\ts -> (Core.bindingName b, ts)) (Core.bindingTypeScheme b)) universeDataElements)) in Graph.Graph { Graph.graphBoundTerms = (Graph.graphBoundTerms baseGraph), Graph.graphBoundTypes = universeBoundTypes,@@ -559,7 +560,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.cat (Lists.map (\d -> case d of+ Logic.ifElse (Logic.not (Logic.not (Lists.null (Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionTerm v0 -> Just (Core.Binding { Core.bindingName = (Packaging.termDefinitionName v0), Core.bindingTerm = (Packaging.termDefinitionBody v0),@@ -568,7 +569,7 @@ Packaging.moduleName = (Packaging.moduleName m), Packaging.moduleMetadata = (Packaging.moduleMetadata m), Packaging.moduleDependencies = (Packaging.moduleDependencies m),- Packaging.moduleDefinitions = (Optionals.cat (Lists.map (\d -> case d of+ Packaging.moduleDefinitions = (Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionType v0 -> Just (Packaging.DefinitionType v0) Packaging.DefinitionTerm v0 -> Optionals.map (\b -> Packaging.DefinitionTerm (Packaging.TermDefinition { Packaging.termDefinitionName = (Core.bindingName b),
src/main/haskell/Hydra/Decode/Ast.hs view
@@ -34,7 +34,7 @@ (Core.Name "left", (\input -> Eithers.map (\t -> Ast.AssociativityLeft) (ExtractCore.decodeUnit cx input))), (Core.Name "right", (\input -> Eithers.map (\t -> Ast.AssociativityRight) (ExtractCore.decodeUnit cx input))), (Core.Name "both", (\input -> Eithers.map (\t -> Ast.AssociativityBoth) (ExtractCore.decodeUnit cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -102,7 +102,7 @@ (Core.Name "op", (\input -> Eithers.map (\t -> Ast.ExprOp t) (opExpr cx input))), (Core.Name "brackets", (\input -> Eithers.map (\t -> Ast.ExprBrackets t) (bracketExpr cx input))), (Core.Name "seq", (\input -> Eithers.map (\t -> Ast.ExprSeq t) (seqExpr cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -132,7 +132,7 @@ Core.LiteralString v2 -> Right v2 _ -> Left (Errors.DecodingError "expected string literal") _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input))))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -241,7 +241,7 @@ _ -> Left (Errors.DecodingError "expected string literal") _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))), (Core.Name "doubleBreak", (\input -> Eithers.map (\t -> Ast.WsDoubleBreak) (ExtractCore.decodeUnit cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))
src/main/haskell/Hydra/Decode/Coders.hs view
@@ -55,7 +55,7 @@ Maps.fromList [ (Core.Name "encode", (\input -> Eithers.map (\t -> Coders.CoderDirectionEncode) (ExtractCore.decodeUnit cx input))), (Core.Name "decode", (\input -> Eithers.map (\t -> Coders.CoderDirectionDecode) (ExtractCore.decodeUnit cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -80,7 +80,7 @@ ( Core.Name "nestedPolymorphicLetBindings", (\input -> Eithers.map (\t -> Coders.LanguageFeatureNestedPolymorphicLetBindings) (ExtractCore.decodeUnit cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -109,7 +109,7 @@ Maps.fromList [ (Core.Name "pre", (\input -> Eithers.map (\t -> Coders.TraversalOrderPre) (ExtractCore.decodeUnit cx input))), (Core.Name "post", (\input -> Eithers.map (\t -> Coders.TraversalOrderPost) (ExtractCore.decodeUnit cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))
src/main/haskell/Hydra/Decode/Core.hs view
@@ -142,7 +142,7 @@ Maps.fromList [ (Core.Name "float32", (\input -> Eithers.map (\t -> Core.FloatTypeFloat32) (ExtractCore.decodeUnit cx input))), (Core.Name "float64", (\input -> Eithers.map (\t -> Core.FloatTypeFloat64) (ExtractCore.decodeUnit cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -176,7 +176,7 @@ _ -> Left (Errors.DecodingError "expected float64 value") _ -> Left (Errors.DecodingError "expected float64 literal") _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input))))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -234,7 +234,7 @@ (Core.Name "uint16", (\input -> Eithers.map (\t -> Core.IntegerTypeUint16) (ExtractCore.decodeUnit cx input))), (Core.Name "uint32", (\input -> Eithers.map (\t -> Core.IntegerTypeUint32) (ExtractCore.decodeUnit cx input))), (Core.Name "uint64", (\input -> Eithers.map (\t -> Core.IntegerTypeUint64) (ExtractCore.decodeUnit cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -331,7 +331,7 @@ _ -> Left (Errors.DecodingError "expected uint64 value") _ -> Left (Errors.DecodingError "expected uint64 literal") _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input))))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -400,7 +400,7 @@ Core.LiteralString v2 -> Right v2 _ -> Left (Errors.DecodingError "expected string literal") _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input))))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -422,7 +422,7 @@ (Core.Name "float", (\input -> Eithers.map (\t -> Core.LiteralTypeFloat t) (floatType cx input))), (Core.Name "integer", (\input -> Eithers.map (\t -> Core.LiteralTypeInteger t) (integerType cx input))), (Core.Name "string", (\input -> Eithers.map (\t -> Core.LiteralTypeString) (ExtractCore.decodeUnit cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -514,7 +514,7 @@ (Core.Name "unwrap", (\input -> Eithers.map (\t -> Core.TermUnwrap t) (name cx input))), (Core.Name "variable", (\input -> Eithers.map (\t -> Core.TermVariable t) (name cx input))), (Core.Name "wrap", (\input -> Eithers.map (\t -> Core.TermWrap t) (wrappedTerm cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -548,7 +548,7 @@ (Core.Name "variable", (\input -> Eithers.map (\t -> Core.TypeVariable t) (name cx input))), (Core.Name "void", (\input -> Eithers.map (\t -> Core.TypeVoid) (ExtractCore.decodeUnit cx input))), (Core.Name "wrap", (\input -> Eithers.map (\t -> Core.TypeWrap t) (type_ cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -576,7 +576,7 @@ variantMap = Maps.fromList [ (Core.Name "simple", (\input -> Eithers.map (\t -> Core.TypeClassConstraintSimple t) (name cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))
src/main/haskell/Hydra/Decode/Docs.hs view
@@ -38,7 +38,7 @@ Core.LiteralString v2 -> Right v2 _ -> Left (Errors.DecodingError "expected string literal") _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input))))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))
src/main/haskell/Hydra/Decode/Error/Checking.hs view
@@ -70,7 +70,7 @@ ( Core.Name "untypedTermVariable", (\input -> Eithers.map (\t -> Checking.CheckingErrorUntypedTermVariable t) (untypedTermVariableCheckingError cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))
src/main/haskell/Hydra/Decode/Error/Core.hs view
@@ -198,7 +198,7 @@ ( Core.Name "typeMismatch", (\input -> Eithers.map (\t -> ErrorCore.InvalidLiteralErrorTypeMismatch t) (literalTypeMismatchError cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -286,7 +286,7 @@ ( Core.Name "untypedTermVariable", (\input -> Eithers.map (\t -> ErrorCore.InvalidTermErrorUntypedTermVariable t) (untypedTermVariableError cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -344,7 +344,7 @@ ( Core.Name "voidInNonBottomPosition", (\input -> Eithers.map (\t -> ErrorCore.InvalidTypeErrorVoidInNonBottomPosition t) (voidInNonBottomPositionError cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))
src/main/haskell/Hydra/Decode/Error/File.hs view
@@ -51,7 +51,7 @@ ( Core.Name "permissionDenied", (\input -> Eithers.map (\t -> ErrorFile.FileErrorPermissionDenied t) (DecodeFile.filePath cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))
src/main/haskell/Hydra/Decode/Error/Packaging.hs view
@@ -133,7 +133,7 @@ ( Core.Name "missingDocumentation", (\input -> Eithers.map (\t -> ErrorPackaging.InvalidModuleErrorMissingDocumentation t) (missingDocumentationError cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -174,7 +174,7 @@ ( Core.Name "undeclaredDependency", (\input -> Eithers.map (\t -> ErrorPackaging.InvalidPackageErrorUndeclaredDependency t) (undeclaredDependencyError cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))
src/main/haskell/Hydra/Decode/Error/System.hs view
@@ -47,7 +47,7 @@ Core.LiteralString v2 -> Right v2 _ -> Left (Errors.DecodingError "expected string literal") _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input))))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))
src/main/haskell/Hydra/Decode/Errors.hs view
@@ -80,7 +80,7 @@ Core.Name "unexpectedTypeVariant", (\input -> Eithers.map (\t -> Errors.ErrorUnexpectedTypeVariant t) (ErrorCore.unexpectedTypeVariantError cx input))), (Core.Name "unification", (\input -> Eithers.map (\t -> Errors.ErrorUnification t) (unificationError cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -115,7 +115,7 @@ ( Core.Name "unexpectedShape", (\input -> Eithers.map (\t -> Errors.ExtractionErrorUnexpectedShape t) (unexpectedShapeError cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -136,7 +136,7 @@ ( Core.Name "unification", (\input -> Eithers.map (\t -> Errors.InferenceErrorUnification t) (unificationInferenceError cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -256,7 +256,7 @@ ( Core.Name "unexpectedShape", (\input -> Eithers.map (\t -> Errors.ResolutionErrorUnexpectedShape t) (unexpectedShapeError cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))
src/main/haskell/Hydra/Decode/File.hs view
@@ -80,7 +80,7 @@ (Core.Name "regular", (\input -> Eithers.map (\t -> File.FileTypeRegular) (ExtractCore.decodeUnit cx input))), (Core.Name "link", (\input -> Eithers.map (\t -> File.FileTypeLink) (ExtractCore.decodeUnit cx input))), (Core.Name "socket", (\input -> Eithers.map (\t -> File.FileTypeSocket) (ExtractCore.decodeUnit cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))
src/main/haskell/Hydra/Decode/Json/Model.hs view
@@ -60,7 +60,7 @@ Core.LiteralString v2 -> Right v2 _ -> Left (Errors.DecodingError "expected string literal") _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input))))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))
src/main/haskell/Hydra/Decode/Packaging.hs view
@@ -34,7 +34,7 @@ (Core.Name "primitive", (\input -> Eithers.map (\t -> Packaging.DefinitionPrimitive t) (primitiveDefinition cx input))), (Core.Name "term", (\input -> Eithers.map (\t -> Packaging.DefinitionTerm t) (termDefinition cx input))), (Core.Name "type", (\input -> Eithers.map (\t -> Packaging.DefinitionType t) (typeDefinition cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -55,7 +55,7 @@ (\input -> Eithers.map (\t -> Packaging.DefinitionReferencePrimitive t) (DecodeCore.name cx input))), (Core.Name "term", (\input -> Eithers.map (\t -> Packaging.DefinitionReferenceTerm t) (DecodeCore.name cx input))), (Core.Name "type", (\input -> Eithers.map (\t -> Packaging.DefinitionReferenceType t) (DecodeCore.name cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -75,7 +75,7 @@ (Core.Name "runtime", (\input -> Eithers.map (\t -> Packaging.DependencyScopeRuntime) (ExtractCore.decodeUnit cx input))), (Core.Name "test", (\input -> Eithers.map (\t -> Packaging.DependencyScopeTest) (ExtractCore.decodeUnit cx input))), (Core.Name "tool", (\input -> Eithers.map (\t -> Packaging.DependencyScopeTool) (ExtractCore.decodeUnit cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -131,7 +131,7 @@ Core.LiteralString v2 -> Right v2 _ -> Left (Errors.DecodingError "expected string literal") _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input))))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -303,7 +303,7 @@ (Core.Name "exact", (\input -> Eithers.map (\t -> Packaging.VersionSpecifierExact t) (version cx input))), (Core.Name "atLeast", (\input -> Eithers.map (\t -> Packaging.VersionSpecifierAtLeast t) (version cx input))), (Core.Name "range", (\input -> Eithers.map (\t -> Packaging.VersionSpecifierRange t) (versionRange cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))
src/main/haskell/Hydra/Decode/Parsing.hs view
@@ -51,7 +51,7 @@ Maps.fromList [ (Core.Name "success", (\input -> Eithers.map (\t -> Parsing.ParseResultSuccess t) (parseSuccess a cx input))), (Core.Name "failure", (\input -> Eithers.map (\t -> Parsing.ParseResultFailure t) (parseError cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))
src/main/haskell/Hydra/Decode/Paths.hs view
@@ -158,7 +158,7 @@ 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)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -254,7 +254,7 @@ (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)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))
src/main/haskell/Hydra/Decode/Query.hs view
@@ -46,7 +46,7 @@ ( Core.Name "greaterThanOrEqual", (\input -> Eithers.map (\t -> Query.ComparisonConstraintGreaterThanOrEqual) (ExtractCore.decodeUnit cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -88,7 +88,7 @@ (Core.Name "term", (\input -> Eithers.map (\t -> Query.NodeTerm t) (DecodeCore.term cx input))), (Core.Name "variable", (\input -> Eithers.map (\t -> Query.NodeVariable t) (variable cx input))), (Core.Name "wildcard", (\input -> Eithers.map (\t -> Query.NodeWildcard) (ExtractCore.decodeUnit cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -107,7 +107,7 @@ (Core.Name "step", (\input -> Eithers.map (\t -> Query.PathStep t) (step cx input))), (Core.Name "regex", (\input -> Eithers.map (\t -> Query.PathRegex t) (regexSequence cx input))), (Core.Name "inverse", (\input -> Eithers.map (\t -> Query.PathInverse t) (path cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -143,7 +143,7 @@ Core.Name "disjunction", (\input -> Eithers.map (\t -> Query.PatternDisjunction t) (ExtractCore.decodeList pattern cx input))), (Core.Name "graph", (\input -> Eithers.map (\t -> Query.PatternGraph t) (graphPattern cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -229,7 +229,7 @@ _ -> Left (Errors.DecodingError "expected int32 literal") _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))), (Core.Name "range", (\input -> Eithers.map (\t -> Query.RegexQuantifierRange t) (range cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -259,7 +259,7 @@ (Core.Name "edge", (\input -> Eithers.map (\t -> Query.StepEdge t) (edge cx input))), (Core.Name "project", (\input -> Eithers.map (\t -> Query.StepProject t) (DecodeCore.projection cx input))), (Core.Name "compare", (\input -> Eithers.map (\t -> Query.StepCompare t) (comparisonConstraint cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))
src/main/haskell/Hydra/Decode/Regex.hs view
@@ -47,7 +47,7 @@ (Core.Name "anchorEnd", (\input -> Eithers.map (\t -> Regex.AtomAnchorEnd) (ExtractCore.decodeUnit cx input))), (Core.Name "group", (\input -> Eithers.map (\t -> Regex.AtomGroup t) (alternation cx input))), (Core.Name "class", (\input -> Eithers.map (\t -> Regex.AtomClass t) (characterClass cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -111,7 +111,7 @@ _ -> Left (Errors.DecodingError "expected int32 literal") _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))), (Core.Name "range", (\input -> Eithers.map (\t -> Regex.ClassItemRange t) (characterRange cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -161,7 +161,7 @@ _ -> Left (Errors.DecodingError "expected int32 literal") _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input)))), (Core.Name "range", (\input -> Eithers.map (\t -> Regex.QuantifierRange_ t) (quantifierRange cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))
src/main/haskell/Hydra/Decode/Util.hs view
@@ -34,7 +34,7 @@ (Core.Name "pascal", (\input -> Eithers.map (\t -> Util.CaseConventionPascal) (ExtractCore.decodeUnit cx input))), (Core.Name "lowerSnake", (\input -> Eithers.map (\t -> Util.CaseConventionLowerSnake) (ExtractCore.decodeUnit cx input))), (Core.Name "upperSnake", (\input -> Eithers.map (\t -> Util.CaseConventionUpperSnake) (ExtractCore.decodeUnit cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -53,7 +53,7 @@ (Core.Name "lessThan", (\input -> Eithers.map (\t -> Util.ComparisonLessThan) (ExtractCore.decodeUnit cx input))), (Core.Name "equalTo", (\input -> Eithers.map (\t -> Util.ComparisonEqualTo) (ExtractCore.decodeUnit cx input))), (Core.Name "greaterThan", (\input -> Eithers.map (\t -> Util.ComparisonGreaterThan) (ExtractCore.decodeUnit cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -90,7 +90,7 @@ _ -> Left (Errors.DecodingError "expected int32 value") _ -> Left (Errors.DecodingError "expected int32 literal") _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input))))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))
src/main/haskell/Hydra/Decode/Variants.hs view
@@ -36,7 +36,7 @@ (Core.Name "float", (\input -> Eithers.map (\t -> Variants.LiteralVariantFloat) (ExtractCore.decodeUnit cx input))), (Core.Name "integer", (\input -> Eithers.map (\t -> Variants.LiteralVariantInteger) (ExtractCore.decodeUnit cx input))), (Core.Name "string", (\input -> Eithers.map (\t -> Variants.LiteralVariantString) (ExtractCore.decodeUnit cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -77,7 +77,7 @@ (Core.Name "unwrap", (\input -> Eithers.map (\t -> Variants.TermVariantUnwrap) (ExtractCore.decodeUnit cx input))), (Core.Name "variable", (\input -> Eithers.map (\t -> Variants.TermVariantVariable) (ExtractCore.decodeUnit cx input))), (Core.Name "wrap", (\input -> Eithers.map (\t -> Variants.TermVariantWrap) (ExtractCore.decodeUnit cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -113,7 +113,7 @@ (Core.Name "variable", (\input -> Eithers.map (\t -> Variants.TypeVariantVariable) (ExtractCore.decodeUnit cx input))), (Core.Name "void", (\input -> Eithers.map (\t -> Variants.TypeVariantVoid) (ExtractCore.decodeUnit cx input))), (Core.Name "wrap", (\input -> Eithers.map (\t -> Variants.TypeVariantWrap) (ExtractCore.decodeUnit cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))
src/main/haskell/Hydra/Decode/Yaml/Model.hs view
@@ -33,7 +33,7 @@ (Core.Name "mapping", (\input -> Eithers.map (\t -> Model.NodeMapping t) (ExtractCore.decodeMap node node cx input))), (Core.Name "scalar", (\input -> Eithers.map (\t -> Model.NodeScalar t) (scalar cx input))), (Core.Name "sequence", (\input -> Eithers.map (\t -> Model.NodeSequence t) (ExtractCore.decodeList node cx input)))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))@@ -89,7 +89,7 @@ Core.LiteralString v2 -> Right v2 _ -> Left (Errors.DecodingError "expected string literal") _ -> Left (Errors.DecodingError "expected literal")) (ExtractCore.stripWithDecodingError cx input))))]- in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.cat [+ in (Optionals.cases (Maps.lookup fname variantMap) (Left (Errors.DecodingError (Strings.concat [ "no such field ", (Core.unName fname), " in union"]))) (\f -> f fterm))
src/main/haskell/Hydra/Decoding.hs view
@@ -116,7 +116,7 @@ let rtype = decoderFullResultTypeNamed (Core.bindingName b) typ rawBody = decodeTypeNamed (Core.bindingName b) typ rtype description =- Strings.cat [+ Strings.concat [ "Decoder for ", (Core.unName (Core.bindingName b))] in (Right (Core.Binding {@@ -448,7 +448,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "float32", " literal"])))})))),@@ -463,7 +463,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "float32", " value"])))})))),@@ -539,7 +539,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "float64", " literal"])))})))),@@ -554,7 +554,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "float64", " value"])))})))),@@ -631,7 +631,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "bigint", " literal"])))})))),@@ -646,7 +646,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "bigint", " value"])))})))),@@ -722,7 +722,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "int8", " literal"])))})))),@@ -737,7 +737,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "int8", " value"])))})))),@@ -813,7 +813,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "int16", " literal"])))})))),@@ -828,7 +828,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "int16", " value"])))})))),@@ -904,7 +904,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "int32", " literal"])))})))),@@ -919,7 +919,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "int32", " value"])))})))),@@ -995,7 +995,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "int64", " literal"])))})))),@@ -1010,7 +1010,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "int64", " value"])))})))),@@ -1086,7 +1086,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "uint8", " literal"])))})))),@@ -1101,7 +1101,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "uint8", " value"])))})))),@@ -1177,7 +1177,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "uint16", " literal"])))})))),@@ -1192,7 +1192,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "uint16", " value"])))})))),@@ -1268,7 +1268,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "uint32", " literal"])))})))),@@ -1283,7 +1283,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "uint32", " value"])))})))),@@ -1359,7 +1359,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "uint64", " literal"])))})))),@@ -1374,7 +1374,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected ", "uint64", " value"])))})))),@@ -1502,7 +1502,7 @@ -- | Transform a type module into a decoder module decodeModule :: t0 -> Graph.Graph -> Packaging.Module -> Either Errors.Error (Maybe Packaging.Module) decodeModule cx graph mod =- Eithers.bind (filterTypeBindings cx graph (Optionals.cat (Lists.map (\d -> case d of+ Eithers.bind (filterTypeBindings cx graph (Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionType v0 -> Just ((\name -> \typ -> let schemaTerm = Core.TermVariable (Core.Name "hydra.core.Type") dataTerm =@@ -1519,11 +1519,11 @@ 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 -> let allDecodedDeps =- Lists.nub (Lists.map decodeModuleName (Lists.map (\dep -> Packaging.moduleDependencyModule dep) (Packaging.moduleDependencies mod)))+ Lists.distinct (Lists.map decodeModuleName (Lists.map (\dep -> Packaging.moduleDependencyModule dep) (Packaging.moduleDependencies mod))) in (Right (Just (Packaging.Module { Packaging.moduleName = (decodeModuleName (Packaging.moduleName mod)), Packaging.moduleMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just (Strings.cat [+ Packaging.entityMetadataDescription = (Just (Strings.concat [ "Term decoders for ", (Packaging.unModuleName (Packaging.moduleName mod))])), Packaging.entityMetadataComments = [],@@ -1594,7 +1594,7 @@ Core.applicationArgument = (Core.TermVariable (Core.Name "fieldMap"))})), Core.applicationArgument = (Core.TermVariable (Core.Name "cx"))}) localVarName =- \ft -> Core.Name (Strings.cat [+ \ft -> Core.Name (Strings.concat [ "field_", (Core.unName (Core.fieldTypeName ft))]) toFieldLambda =@@ -1658,7 +1658,7 @@ Core.typeApplicationTermBody = (Core.TermTypeApplication (Core.TypeApplicationTerm { Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"),- Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.cat [+ Core.wrappedTermBody = (Core.TermLiteral (Core.LiteralString (Strings.concat [ "expected a record of type ", (Core.unName tname)])))})))), Core.typeApplicationTermType = (Core.TypeVariable (Core.Name "hydra.errors.DecodingError"))})),@@ -1958,7 +1958,7 @@ Core.typeApplicationTermBody = (Core.TermEither (Left (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = (Core.Name "hydra.errors.DecodingError"), Core.wrappedTermBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.cat")),+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.concat")), Core.applicationArgument = (Core.TermList [ Core.TermLiteral (Core.LiteralString "no such field "), (Core.TermApplication (Core.Application {@@ -2196,7 +2196,7 @@ let typeVars = collectTypeVariables typ allOrdVars = collectOrdConstrainedVariables typ- ordVars = Lists.filter (\v -> Lists.elem v typeVars) allOrdVars+ ordVars = Lists.filter (\v -> Lists.member v typeVars) allOrdVars constraints = Logic.ifElse (Lists.null ordVars) Nothing (Just (Maps.fromList (Lists.map (\v -> ( v,@@ -2214,7 +2214,7 @@ let typeVars = collectTypeVariables typ allOrdVars = collectOrdConstrainedVariables typ- ordVars = Lists.filter (\v -> Lists.elem v typeVars) allOrdVars+ ordVars = Lists.filter (\v -> Lists.member v typeVars) allOrdVars constraints = Logic.ifElse (Lists.null ordVars) Nothing (Just (Maps.fromList (Lists.map (\v -> ( v,@@ -2229,7 +2229,7 @@ -- | Filter bindings to only decodable type definitions filterTypeBindings :: t0 -> Graph.Graph -> [Core.Binding] -> Either Errors.Error [Core.Binding] filterTypeBindings cx graph bindings =- Eithers.map Optionals.cat (Eithers.mapList (isDecodableBinding cx graph) (Lists.filter Annotations.isNativeType bindings))+ Eithers.map Optionals.givens (Eithers.mapList (isDecodableBinding cx graph) (Lists.filter Annotations.isNativeType bindings)) -- | Check if a binding is decodable (serializable type) isDecodableBinding :: t0 -> Graph.Graph -> Core.Binding -> Either Errors.Error (Maybe Core.Binding)
src/main/haskell/Hydra/Dependencies.hs view
@@ -28,6 +28,7 @@ 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+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@@ -62,7 +63,7 @@ definitionsWithDependencies cx graph original = let depNames = \el -> Sets.toList (termDependencyNames True False False (Core.bindingTerm el))- allDepNames = Lists.nub (Lists.concat2 (Lists.map Core.bindingName original) (Lists.concat (Lists.map depNames original)))+ allDepNames = Lists.distinct (Lists.concat2 (Lists.map Core.bindingName original) (Lists.concat (Lists.map depNames original))) in (Eithers.mapList (\name -> Lexical.requireBinding graph name) allDepNames) -- | Flatten nested let expressions@@ -97,8 +98,8 @@ Core.TermLet v0 -> let bindings1 = Core.letBindings v0 body1 = Core.letBody v0- prefix = Strings.cat2 (Core.unName key0) "_"- qualify = \n -> Core.Name (Strings.cat2 prefix (Core.unName n))+ prefix = Strings.concat2 (Core.unName key0) "_"+ qualify = \n -> Core.Name (Strings.concat2 prefix (Core.unName n)) toSubstPair = \b -> (Core.bindingName b, (qualify (Core.bindingName b))) subst = Maps.fromList (Lists.map toSubstPair bindings1) replaceVars = Variables.substituteVariables subst@@ -153,7 +154,7 @@ \recurse -> \typ2 -> let afterRecurse = \tr -> case tr of- Core.TypeVariable v0 -> Optionals.cases (Maps.lookup v0 schema) (Left (Errors.ErrorOther (Errors.OtherError (Strings.cat2 "No such type in schema: " (Core.unName v0))))) (inlineType schema)+ Core.TypeVariable v0 -> Optionals.cases (Maps.lookup v0 schema) (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat2 "No such type in schema: " (Core.unName v0))))) (inlineType schema) _ -> Right tr in (Eithers.bind (recurse typ2) (\tr -> afterRecurse tr)) in (Rewriting.rewriteTypeM f typ)@@ -205,7 +206,7 @@ let bindingMap = Maps.fromList (Lists.map (\b -> (Core.bindingName b, (Core.bindingTerm b))) (Core.letBindings l)) rootName = Core.Name "[[[root]]]" adj =- \n -> Sets.intersection (Sets.fromList (Maps.keys bindingMap)) (Variables.freeVariablesInTerm (Logic.ifElse (Equality.equal n rootName) (Core.letBody l) (Optionals.fromOptional Core.TermUnit (Maps.lookup n bindingMap))))+ \n -> Sets.intersection (Sets.fromList (Maps.keys bindingMap)) (Variables.freeVariablesInTerm (Logic.ifElse (Equality.equal n rootName) (Core.letBody l) (Optionals.withDefault Core.TermUnit (Maps.lookup n bindingMap)))) reachable = Sorting.findReachableNodes adj rootName prunedBindings = Lists.filter (\b -> Sets.member (Core.bindingName b) reachable) (Core.letBindings l) in Core.Let {@@ -294,7 +295,7 @@ let addName = \acc -> \name -> let local = Names.localNameOf name- group = Optionals.fromOptional Sets.empty (Maps.lookup local acc)+ group = Optionals.withDefault Sets.empty (Maps.lookup local acc) in (Maps.insert local (Sets.insert name group) acc) groupNamesByLocal = \names -> Lists.foldl addName Maps.empty names groups = groupNamesByLocal original@@ -304,7 +305,7 @@ names = Pairs.second localNames rangeFrom = \start -> Lists.cons start (rangeFrom (Math.add start 1)) rename =- \name -> \i -> (name, (Core.Name (Logic.ifElse (Equality.gt i 1) (Strings.cat2 local (Literals.showInt32 i)) local)))+ \name -> \i -> (name, (Core.Name (Logic.ifElse (Ordering.gt i 1) (Strings.concat2 local (Literals.showInt32 i)) local))) in (Lists.zipWith rename (Sets.toList names) (rangeFrom 1)) in (Maps.fromList (Lists.concat (Lists.map renameGroup (Maps.toList groups)))) @@ -321,7 +322,7 @@ term = Pairs.second nameAndTerm in (name, (Logic.ifElse (hasTypeAnnotation term) [] (Sets.toList (Sets.intersection keys (Variables.freeVariablesInTerm term))))) toPair =- \name -> (name, (Optionals.fromOptional (Core.TermLiteral (Core.LiteralString "Impossible!")) (Maps.lookup name bindingMap)))+ \name -> (name, (Optionals.withDefault (Core.TermLiteral (Core.LiteralString "Impossible!")) (Maps.lookup name bindingMap))) in (Lists.map (Lists.map toPair) (Sorting.topologicalSortComponents (Lists.map depsOf bindings))) -- | Topological sort of bindings based on their dependencies. Returns `Right` with a flat order when the dependency graph is acyclic; returns `Left` with the cyclic SCCs when it is not. Use this variant when the consumer needs a strict acyclic ordering and must reject cycles (e.g. import resolution); use `topologicalSortBindingMap` when mutual recursion should be packaged into SCC groups instead.@@ -341,7 +342,7 @@ (Sets.toList (typeDependencyNames False (Core.typeSchemeBody (Packaging.typeDefinitionBody def))))) nameToDef = Maps.fromList (Lists.map (\d -> (Packaging.typeDefinitionName d, d)) defs) sorted = Sorting.topologicalSortComponents (Lists.map toPair defs)- in (Lists.map (\names -> Optionals.cat (Lists.map (\n -> Maps.lookup n nameToDef) names)) sorted)+ in (Lists.map (\names -> Optionals.givens (Lists.map (\n -> Maps.lookup n nameToDef) names)) sorted) -- | Collect all type names referenced by a type. The boolean controls whether type-scheme references (free variables in type expressions) are included alongside structural references typeDependencyNames :: Bool -> Core.Type -> S.Set Core.Name
src/main/haskell/Hydra/Dsl/Lib/Chars.hs view
@@ -66,56 +66,56 @@ -- | DSL reference to hydra.lib.chars.isAlpha isAlpha :: Typed.TypedTerm Int -> Typed.TypedTerm Bool-isAlpha arg0 =+isAlpha char = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.chars.isAlpha")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm char)})) -- | DSL reference to hydra.lib.chars.isAlphaNum isAlphaNum :: Typed.TypedTerm Int -> Typed.TypedTerm Bool-isAlphaNum arg0 =+isAlphaNum char = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.chars.isAlphaNum")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm char)})) -- | DSL reference to hydra.lib.chars.isDigit isDigit :: Typed.TypedTerm Int -> Typed.TypedTerm Bool-isDigit arg0 =+isDigit char = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.chars.isDigit")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm char)})) -- | DSL reference to hydra.lib.chars.isLower isLower :: Typed.TypedTerm Int -> Typed.TypedTerm Bool-isLower arg0 =+isLower char = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.chars.isLower")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm char)})) -- | DSL reference to hydra.lib.chars.isSpace isSpace :: Typed.TypedTerm Int -> Typed.TypedTerm Bool-isSpace arg0 =+isSpace char = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.chars.isSpace")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm char)})) -- | DSL reference to hydra.lib.chars.isUpper isUpper :: Typed.TypedTerm Int -> Typed.TypedTerm Bool-isUpper arg0 =+isUpper char = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.chars.isUpper")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm char)})) -- | DSL reference to hydra.lib.chars.toLower toLower :: Typed.TypedTerm Int -> Typed.TypedTerm Int-toLower arg0 =+toLower char = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.chars.toLower")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm char)})) -- | DSL reference to hydra.lib.chars.toUpper toUpper :: Typed.TypedTerm Int -> Typed.TypedTerm Int-toUpper arg0 =+toUpper char = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.chars.toUpper")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm char)}))
src/main/haskell/Hydra/Dsl/Lib/Eithers.hs view
@@ -67,176 +67,140 @@ -- | DSL reference to hydra.lib.eithers.apply apply :: Typed.TypedTerm (Either x (y -> z)) -> Typed.TypedTerm (Either x y) -> Typed.TypedTerm (Either x z)-apply arg0 arg1 =+apply ef ex = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.apply")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm ef)})),+ Core.applicationArgument = (Typed.unTypedTerm ex)})) -- | DSL reference to hydra.lib.eithers.bimap bimap :: Typed.TypedTerm (x -> z) -> Typed.TypedTerm (y -> w) -> Typed.TypedTerm (Either x y) -> Typed.TypedTerm (Either z w)-bimap arg0 arg1 arg2 =+bimap f g e = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.bimap")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm g)})),+ Core.applicationArgument = (Typed.unTypedTerm e)})) -- | DSL reference to hydra.lib.eithers.bind bind :: Typed.TypedTerm (Either x y) -> Typed.TypedTerm (y -> Either x z) -> Typed.TypedTerm (Either x z)-bind arg0 arg1 =+bind e f = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.bind")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm e)})),+ Core.applicationArgument = (Typed.unTypedTerm f)})) -- | DSL reference to hydra.lib.eithers.compose compose :: Typed.TypedTerm (x -> Either w y) -> Typed.TypedTerm (y -> Either w z) -> Typed.TypedTerm x -> Typed.TypedTerm (Either w z)-compose arg0 arg1 arg2 =+compose f g x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.compose")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm g)})),+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.eithers.either either :: Typed.TypedTerm (x -> z) -> Typed.TypedTerm (y -> z) -> Typed.TypedTerm (Either x y) -> Typed.TypedTerm z-either arg0 arg1 arg2 =+either f g e = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm g)})),+ Core.applicationArgument = (Typed.unTypedTerm e)})) -- | DSL reference to hydra.lib.eithers.foldList foldList :: Typed.TypedTerm (x -> y -> Either z x) -> Typed.TypedTerm x -> Typed.TypedTerm [y] -> Typed.TypedTerm (Either z x)-foldList arg0 arg1 arg2 =+foldList f acc0 xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.foldList")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.lib.eithers.foldl-foldl :: Typed.TypedTerm (x -> y -> Either z x) -> Typed.TypedTerm x -> Typed.TypedTerm [y] -> Typed.TypedTerm (Either z x)-foldl arg0 arg1 arg2 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.foldl")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.lib.eithers.fromLeft-fromLeft :: Typed.TypedTerm x -> Typed.TypedTerm (Either x y) -> Typed.TypedTerm x-fromLeft arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.fromLeft")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lib.eithers.fromRight-fromRight :: Typed.TypedTerm y -> Typed.TypedTerm (Either x y) -> Typed.TypedTerm y-fromRight arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.fromRight")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm acc0)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.eithers.isLeft isLeft :: Typed.TypedTerm (Either x y) -> Typed.TypedTerm Bool-isLeft arg0 =+isLeft e = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.isLeft")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm e)})) -- | DSL reference to hydra.lib.eithers.isRight isRight :: Typed.TypedTerm (Either x y) -> Typed.TypedTerm Bool-isRight arg0 =+isRight e = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.isRight")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm e)})) -- | DSL reference to hydra.lib.eithers.lefts lefts :: Typed.TypedTerm [Either x y] -> Typed.TypedTerm [x]-lefts arg0 =+lefts xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.lefts")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.eithers.map map :: Typed.TypedTerm (x -> y) -> Typed.TypedTerm (Either z x) -> Typed.TypedTerm (Either z y)-map arg0 arg1 =+map f e = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.map")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm e)})) -- | DSL reference to hydra.lib.eithers.mapList mapList :: Typed.TypedTerm (x -> Either z y) -> Typed.TypedTerm [x] -> Typed.TypedTerm (Either z [y])-mapList arg0 arg1 =+mapList f xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.mapList")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.eithers.mapOptional mapOptional :: Typed.TypedTerm (x -> Either z y) -> Typed.TypedTerm (Maybe x) -> Typed.TypedTerm (Either z (Maybe y))-mapOptional arg0 arg1 =+mapOptional f m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.mapOptional")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ 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 arg0 arg1 =+mapSet f s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.mapSet")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.eithers.partition partition :: Typed.TypedTerm [Either x y] -> Typed.TypedTerm ([x], [y])-partition arg0 =+partition xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.partition")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.lib.eithers.partitionEithers-partitionEithers :: Typed.TypedTerm [Either x y] -> Typed.TypedTerm ([x], [y])-partitionEithers arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.partitionEithers")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.eithers.pure pure :: Typed.TypedTerm y -> Typed.TypedTerm (Either x y)-pure arg0 =+pure x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.pure")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.eithers.rights rights :: Typed.TypedTerm [Either x y] -> Typed.TypedTerm [y]-rights arg0 =+rights xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.rights")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm xs)}))
src/main/haskell/Hydra/Dsl/Lib/Equality.hs view
@@ -64,90 +64,20 @@ import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, map, pure, sum) import qualified Data.Scientific as Sci --- | DSL reference to hydra.lib.equality.compare-compare :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Util.Comparison-compare arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.equality.compare")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))- -- | DSL reference to hydra.lib.equality.equal equal :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Bool-equal arg0 arg1 =+equal x y = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.equality.equal")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lib.equality.gt-gt :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Bool-gt arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.equality.gt")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lib.equality.gte-gte :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Bool-gte arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.equality.gte")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lib.equality.identity-identity :: Typed.TypedTerm x -> Typed.TypedTerm x-identity arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.equality.identity")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.lib.equality.lt-lt :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Bool-lt arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.equality.lt")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lib.equality.lte-lte :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Bool-lte arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.equality.lte")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lib.equality.max-max :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm x-max arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.equality.max")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lib.equality.min-min :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm x-min arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.equality.min")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ Core.applicationArgument = (Typed.unTypedTerm y)})) -- | DSL reference to hydra.lib.equality.notEqual notEqual :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Bool-notEqual arg0 arg1 =+notEqual x y = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.equality.notEqual")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ Core.applicationArgument = (Typed.unTypedTerm y)}))
src/main/haskell/Hydra/Dsl/Lib/Functions.hs view
@@ -66,38 +66,38 @@ -- | DSL reference to hydra.lib.functions.compose compose :: Typed.TypedTerm (t2 -> t3) -> Typed.TypedTerm (t1 -> t2) -> Typed.TypedTerm t1 -> Typed.TypedTerm t3-compose arg0 arg1 arg2 =+compose g f x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.functions.compose")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))+ Core.applicationArgument = (Typed.unTypedTerm g)})),+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.functions.const const :: Typed.TypedTerm t1 -> Typed.TypedTerm t2 -> Typed.TypedTerm t1-const arg0 arg1 =+const x y = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.functions.const")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ Core.applicationArgument = (Typed.unTypedTerm y)})) -- | DSL reference to hydra.lib.functions.flip flip :: Typed.TypedTerm (t1 -> t2 -> t3) -> Typed.TypedTerm t2 -> Typed.TypedTerm t1 -> Typed.TypedTerm t3-flip arg0 arg1 arg2 =+flip f x y = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.functions.flip")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ Core.applicationArgument = (Typed.unTypedTerm y)})) -- | DSL reference to hydra.lib.functions.identity identity :: Typed.TypedTerm t1 -> Typed.TypedTerm t1-identity arg0 =+identity x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.functions.identity")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)}))
src/main/haskell/Hydra/Dsl/Lib/Lists.hs view
@@ -67,438 +67,367 @@ -- | DSL reference to hydra.lib.lists.apply apply :: Typed.TypedTerm [x -> y] -> Typed.TypedTerm [x] -> Typed.TypedTerm [y]-apply arg0 arg1 =+apply fs xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.apply")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm fs)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.at at :: Typed.TypedTerm Int -> Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe x)-at arg0 arg1 =+at i xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.at")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm i)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.bind bind :: Typed.TypedTerm [x] -> Typed.TypedTerm (x -> [y]) -> Typed.TypedTerm [y]-bind arg0 arg1 =+bind xs f = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.bind")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm xs)})),+ Core.applicationArgument = (Typed.unTypedTerm f)})) -- | DSL reference to hydra.lib.lists.compose compose :: Typed.TypedTerm (x -> [y]) -> Typed.TypedTerm (y -> [z]) -> Typed.TypedTerm x -> Typed.TypedTerm [z]-compose arg0 arg1 arg2 =+compose f g x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.compose")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm g)})),+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.lists.concat concat :: Typed.TypedTerm [[x]] -> Typed.TypedTerm [x]-concat arg0 =+concat xss = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.concat")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm xss)})) -- | DSL reference to hydra.lib.lists.concat2 concat2 :: Typed.TypedTerm [x] -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]-concat2 arg0 arg1 =+concat2 xs ys = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.concat2")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm xs)})),+ Core.applicationArgument = (Typed.unTypedTerm ys)})) -- | DSL reference to hydra.lib.lists.cons cons :: Typed.TypedTerm x -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]-cons arg0 arg1 =+cons x xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.cons")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.distinct distinct :: Typed.TypedTerm [x] -> Typed.TypedTerm [x]-distinct arg0 =+distinct xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.distinct")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.drop drop :: Typed.TypedTerm Int -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]-drop arg0 arg1 =+drop n xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.drop")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm n)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.dropWhile dropWhile :: Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]-dropWhile arg0 arg1 =+dropWhile p xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.dropWhile")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lib.lists.elem-elem :: Typed.TypedTerm x -> Typed.TypedTerm [x] -> Typed.TypedTerm Bool-elem arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.elem")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm p)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.filter filter :: Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]-filter arg0 arg1 =+filter p xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.filter")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm p)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.find find :: Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe x)-find arg0 arg1 =+find p xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.find")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm p)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.foldList foldList :: Typed.TypedTerm (x -> y -> [x]) -> Typed.TypedTerm x -> Typed.TypedTerm [y] -> Typed.TypedTerm [x]-foldList arg0 arg1 arg2 =+foldList f acc0 xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.foldList")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm acc0)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.foldl foldl :: Typed.TypedTerm (y -> x -> y) -> Typed.TypedTerm y -> Typed.TypedTerm [x] -> Typed.TypedTerm y-foldl arg0 arg1 arg2 =+foldl f acc0 xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.foldl")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm acc0)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.foldr foldr :: Typed.TypedTerm (x -> y -> y) -> Typed.TypedTerm y -> Typed.TypedTerm [x] -> Typed.TypedTerm y-foldr arg0 arg1 arg2 =+foldr f acc0 xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.foldr")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm acc0)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.group group :: Typed.TypedTerm [x] -> Typed.TypedTerm [[x]]-group arg0 =+group xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.group")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.head head :: Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe x)-head arg0 =+head xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.head")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.init init :: Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe [x])-init arg0 =+init xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.init")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.lib.lists.intercalate-intercalate :: Typed.TypedTerm [x] -> Typed.TypedTerm [[x]] -> Typed.TypedTerm [x]-intercalate arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.intercalate")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.intersperse intersperse :: Typed.TypedTerm x -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]-intersperse arg0 arg1 =+intersperse sep xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.intersperse")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm sep)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.join join :: Typed.TypedTerm [x] -> Typed.TypedTerm [[x]] -> Typed.TypedTerm [x]-join arg0 arg1 =+join sep xss = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.join")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm sep)})),+ Core.applicationArgument = (Typed.unTypedTerm xss)})) -- | DSL reference to hydra.lib.lists.last last :: Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe x)-last arg0 =+last xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.last")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.length length :: Typed.TypedTerm [x] -> Typed.TypedTerm Int-length arg0 =+length xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.length")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.map map :: Typed.TypedTerm (x -> y) -> Typed.TypedTerm [x] -> Typed.TypedTerm [y]-map arg0 arg1 =+map f xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.map")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.mapList mapList :: Typed.TypedTerm (x -> [y]) -> Typed.TypedTerm [x] -> Typed.TypedTerm [[y]]-mapList arg0 arg1 =+mapList f xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.mapList")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.mapOptional mapOptional :: Typed.TypedTerm (x -> [y]) -> Typed.TypedTerm (Maybe x) -> Typed.TypedTerm [Maybe y]-mapOptional arg0 arg1 =+mapOptional f m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.mapOptional")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ 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 arg0 arg1 =+mapSet f s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.mapSet")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lib.lists.maybeAt-maybeAt :: Typed.TypedTerm Int -> Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe x)-maybeAt arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.maybeAt")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lib.lists.maybeHead-maybeHead :: Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe x)-maybeHead arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.maybeHead")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.lib.lists.maybeInit-maybeInit :: Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe [x])-maybeInit arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.maybeInit")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.lib.lists.maybeLast-maybeLast :: Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe x)-maybeLast arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.maybeLast")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.lib.lists.maybeTail-maybeTail :: Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe [x])-maybeTail arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.maybeTail")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.lists.member member :: Typed.TypedTerm x -> Typed.TypedTerm [x] -> Typed.TypedTerm Bool-member arg0 arg1 =+member x xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.member")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lib.lists.nub-nub :: Typed.TypedTerm [x] -> Typed.TypedTerm [x]-nub arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.nub")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ 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 arg0 =+null xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.null")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ 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 arg0 arg1 =+partition p xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.partition")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ 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 arg0 =+pure x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.pure")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.lists.replicate replicate :: Typed.TypedTerm Int -> Typed.TypedTerm x -> Typed.TypedTerm [x]-replicate arg0 arg1 =+replicate n x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.replicate")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm n)})),+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.lists.reverse reverse :: Typed.TypedTerm [x] -> Typed.TypedTerm [x]-reverse arg0 =+reverse xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.reverse")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.singleton singleton :: Typed.TypedTerm x -> Typed.TypedTerm [x]-singleton arg0 =+singleton x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.singleton")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.lists.sort sort :: Typed.TypedTerm [x] -> Typed.TypedTerm [x]-sort arg0 =+sort xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.sort")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.sortBy sortBy :: Typed.TypedTerm (x -> y) -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]-sortBy arg0 arg1 =+sortBy f xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.sortBy")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lib.lists.sortOn-sortOn :: Typed.TypedTerm (x -> y) -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]-sortOn arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.sortOn")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.span span :: Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm [x] -> Typed.TypedTerm ([x], [x])-span arg0 arg1 =+span p xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.span")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm p)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.tail tail :: Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe [x])-tail arg0 =+tail xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.tail")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.take take :: Typed.TypedTerm Int -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]-take arg0 arg1 =+take n xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.take")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm n)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.takeWhile takeWhile :: Typed.TypedTerm (x -> Bool) -> Typed.TypedTerm [x] -> Typed.TypedTerm [x]-takeWhile arg0 arg1 =+takeWhile p xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.takeWhile")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm p)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.transpose transpose :: Typed.TypedTerm [[x]] -> Typed.TypedTerm [[x]]-transpose arg0 =+transpose xss = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.transpose")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm xss)})) -- | DSL reference to hydra.lib.lists.uncons uncons :: Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe (x, [x]))-uncons arg0 =+uncons xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.uncons")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.lists.zip zip :: Typed.TypedTerm [x] -> Typed.TypedTerm [y] -> Typed.TypedTerm [(x, y)]-zip arg0 arg1 =+zip xs ys = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.zip")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm xs)})),+ Core.applicationArgument = (Typed.unTypedTerm ys)})) -- | DSL reference to hydra.lib.lists.zipWith zipWith :: Typed.TypedTerm (x -> y -> z) -> Typed.TypedTerm [x] -> Typed.TypedTerm [y] -> Typed.TypedTerm [z]-zipWith arg0 arg1 arg2 =+zipWith f xs ys = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.zipWith")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})),+ Core.applicationArgument = (Typed.unTypedTerm ys)}))
src/main/haskell/Hydra/Dsl/Lib/Literals.hs view
@@ -66,387 +66,387 @@ import qualified Data.ByteString as B import qualified Data.Int as I +-- | DSL reference to hydra.lib.literals.base64ToBinary+base64ToBinary :: Typed.TypedTerm String -> Typed.TypedTerm B.ByteString+base64ToBinary s =+ Typed.TypedTerm (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.base64ToBinary")),+ Core.applicationArgument = (Typed.unTypedTerm s)}))+ -- | DSL reference to hydra.lib.literals.bigintToDecimal bigintToDecimal :: Typed.TypedTerm Integer -> Typed.TypedTerm Sci.Scientific-bigintToDecimal arg0 =+bigintToDecimal x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.bigintToDecimal")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.bigintToInt16 bigintToInt16 :: Typed.TypedTerm Integer -> Typed.TypedTerm I.Int16-bigintToInt16 arg0 =+bigintToInt16 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.bigintToInt16")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.bigintToInt32 bigintToInt32 :: Typed.TypedTerm Integer -> Typed.TypedTerm Int-bigintToInt32 arg0 =+bigintToInt32 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.bigintToInt32")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.bigintToInt64 bigintToInt64 :: Typed.TypedTerm Integer -> Typed.TypedTerm I.Int64-bigintToInt64 arg0 =+bigintToInt64 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.bigintToInt64")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.bigintToInt8 bigintToInt8 :: Typed.TypedTerm Integer -> Typed.TypedTerm I.Int8-bigintToInt8 arg0 =+bigintToInt8 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.bigintToInt8")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.bigintToUint16 bigintToUint16 :: Typed.TypedTerm Integer -> Typed.TypedTerm Int-bigintToUint16 arg0 =+bigintToUint16 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.bigintToUint16")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.bigintToUint32 bigintToUint32 :: Typed.TypedTerm Integer -> Typed.TypedTerm I.Int64-bigintToUint32 arg0 =+bigintToUint32 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.bigintToUint32")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.bigintToUint64 bigintToUint64 :: Typed.TypedTerm Integer -> Typed.TypedTerm Integer-bigintToUint64 arg0 =+bigintToUint64 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.bigintToUint64")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.bigintToUint8 bigintToUint8 :: Typed.TypedTerm Integer -> Typed.TypedTerm I.Int16-bigintToUint8 arg0 =+bigintToUint8 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.bigintToUint8")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) +-- | DSL reference to hydra.lib.literals.binaryToBase64+binaryToBase64 :: Typed.TypedTerm B.ByteString -> Typed.TypedTerm String+binaryToBase64 b =+ Typed.TypedTerm (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.binaryToBase64")),+ Core.applicationArgument = (Typed.unTypedTerm b)}))+ -- | DSL reference to hydra.lib.literals.binaryToBytes binaryToBytes :: Typed.TypedTerm B.ByteString -> Typed.TypedTerm [Int]-binaryToBytes arg0 =+binaryToBytes b = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.binaryToBytes")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.lib.literals.binaryToString-binaryToString :: Typed.TypedTerm B.ByteString -> Typed.TypedTerm String-binaryToString arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.binaryToString")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm b)})) -- | DSL reference to hydra.lib.literals.decimalToBigint decimalToBigint :: Typed.TypedTerm Sci.Scientific -> Typed.TypedTerm Integer-decimalToBigint arg0 =+decimalToBigint x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.decimalToBigint")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.decimalToFloat32 decimalToFloat32 :: Typed.TypedTerm Sci.Scientific -> Typed.TypedTerm Float-decimalToFloat32 arg0 =+decimalToFloat32 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.decimalToFloat32")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.decimalToFloat64 decimalToFloat64 :: Typed.TypedTerm Sci.Scientific -> Typed.TypedTerm Double-decimalToFloat64 arg0 =+decimalToFloat64 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.decimalToFloat64")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.float32ToDecimal float32ToDecimal :: Typed.TypedTerm Float -> Typed.TypedTerm Sci.Scientific-float32ToDecimal arg0 =+float32ToDecimal x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.float32ToDecimal")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.float32ToFloat64 float32ToFloat64 :: Typed.TypedTerm Float -> Typed.TypedTerm Double-float32ToFloat64 arg0 =+float32ToFloat64 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.float32ToFloat64")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.float64ToDecimal float64ToDecimal :: Typed.TypedTerm Double -> Typed.TypedTerm Sci.Scientific-float64ToDecimal arg0 =+float64ToDecimal x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.float64ToDecimal")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.float64ToFloat32 float64ToFloat32 :: Typed.TypedTerm Double -> Typed.TypedTerm Float-float64ToFloat32 arg0 =+float64ToFloat32 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.float64ToFloat32")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.int16ToBigint int16ToBigint :: Typed.TypedTerm I.Int16 -> Typed.TypedTerm Integer-int16ToBigint arg0 =+int16ToBigint x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.int16ToBigint")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.int32ToBigint int32ToBigint :: Typed.TypedTerm Int -> Typed.TypedTerm Integer-int32ToBigint arg0 =+int32ToBigint x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.int32ToBigint")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.int64ToBigint int64ToBigint :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm Integer-int64ToBigint arg0 =+int64ToBigint x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.int64ToBigint")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.int8ToBigint int8ToBigint :: Typed.TypedTerm I.Int8 -> Typed.TypedTerm Integer-int8ToBigint arg0 =+int8ToBigint x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.int8ToBigint")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) +-- | DSL reference to hydra.lib.literals.parseBoolean+parseBoolean :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Bool)+parseBoolean s =+ Typed.TypedTerm (Core.TermApplication (Core.Application {+ 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 =+ Typed.TypedTerm (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.parseString")),+ 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 =+ Typed.TypedTerm (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.printString")),+ Core.applicationArgument = (Typed.unTypedTerm s)}))+ -- | DSL reference to hydra.lib.literals.readBigint readBigint :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Integer)-readBigint arg0 =+readBigint s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readBigint")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.lib.literals.readBoolean-readBoolean :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Bool)-readBoolean arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readBoolean")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.literals.readDecimal readDecimal :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Sci.Scientific)-readDecimal arg0 =+readDecimal s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readDecimal")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.literals.readFloat32 readFloat32 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Float)-readFloat32 arg0 =+readFloat32 s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readFloat32")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.literals.readFloat64 readFloat64 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Double)-readFloat64 arg0 =+readFloat64 s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readFloat64")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.literals.readInt16 readInt16 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int16)-readInt16 arg0 =+readInt16 s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readInt16")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.literals.readInt32 readInt32 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Int)-readInt32 arg0 =+readInt32 s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readInt32")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.literals.readInt64 readInt64 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int64)-readInt64 arg0 =+readInt64 s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readInt64")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.literals.readInt8 readInt8 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int8)-readInt8 arg0 =+readInt8 s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readInt8")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.lib.literals.readString-readString :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe String)-readString arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readString")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.literals.readUint16 readUint16 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Int)-readUint16 arg0 =+readUint16 s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readUint16")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.literals.readUint32 readUint32 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int64)-readUint32 arg0 =+readUint32 s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readUint32")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.literals.readUint64 readUint64 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe Integer)-readUint64 arg0 =+readUint64 s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readUint64")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.literals.readUint8 readUint8 :: Typed.TypedTerm String -> Typed.TypedTerm (Maybe I.Int16)-readUint8 arg0 =+readUint8 s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.readUint8")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.literals.showBigint showBigint :: Typed.TypedTerm Integer -> Typed.TypedTerm String-showBigint arg0 =+showBigint x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showBigint")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.lib.literals.showBoolean-showBoolean :: Typed.TypedTerm Bool -> Typed.TypedTerm String-showBoolean arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showBoolean")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.showDecimal showDecimal :: Typed.TypedTerm Sci.Scientific -> Typed.TypedTerm String-showDecimal arg0 =+showDecimal x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showDecimal")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.showFloat32 showFloat32 :: Typed.TypedTerm Float -> Typed.TypedTerm String-showFloat32 arg0 =+showFloat32 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showFloat32")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.showFloat64 showFloat64 :: Typed.TypedTerm Double -> Typed.TypedTerm String-showFloat64 arg0 =+showFloat64 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showFloat64")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.showInt16 showInt16 :: Typed.TypedTerm I.Int16 -> Typed.TypedTerm String-showInt16 arg0 =+showInt16 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showInt16")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.showInt32 showInt32 :: Typed.TypedTerm Int -> Typed.TypedTerm String-showInt32 arg0 =+showInt32 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showInt32")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.showInt64 showInt64 :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm String-showInt64 arg0 =+showInt64 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showInt64")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.showInt8 showInt8 :: Typed.TypedTerm I.Int8 -> Typed.TypedTerm String-showInt8 arg0 =+showInt8 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showInt8")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.lib.literals.showString-showString :: Typed.TypedTerm String -> Typed.TypedTerm String-showString arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showString")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.showUint16 showUint16 :: Typed.TypedTerm Int -> Typed.TypedTerm String-showUint16 arg0 =+showUint16 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showUint16")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.showUint32 showUint32 :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm String-showUint32 arg0 =+showUint32 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showUint32")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.showUint64 showUint64 :: Typed.TypedTerm Integer -> Typed.TypedTerm String-showUint64 arg0 =+showUint64 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showUint64")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.showUint8 showUint8 :: Typed.TypedTerm I.Int16 -> Typed.TypedTerm String-showUint8 arg0 =+showUint8 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.showUint8")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.lib.literals.stringToBinary-stringToBinary :: Typed.TypedTerm String -> Typed.TypedTerm B.ByteString-stringToBinary arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.stringToBinary")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.uint16ToBigint uint16ToBigint :: Typed.TypedTerm Int -> Typed.TypedTerm Integer-uint16ToBigint arg0 =+uint16ToBigint x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.uint16ToBigint")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.uint32ToBigint uint32ToBigint :: Typed.TypedTerm I.Int64 -> Typed.TypedTerm Integer-uint32ToBigint arg0 =+uint32ToBigint x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.uint32ToBigint")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.uint64ToBigint uint64ToBigint :: Typed.TypedTerm Integer -> Typed.TypedTerm Integer-uint64ToBigint arg0 =+uint64ToBigint x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.uint64ToBigint")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.literals.uint8ToBigint uint8ToBigint :: Typed.TypedTerm I.Int16 -> Typed.TypedTerm Integer-uint8ToBigint arg0 =+uint8ToBigint x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.literals.uint8ToBigint")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)}))
src/main/haskell/Hydra/Dsl/Lib/Logic.hs view
@@ -66,36 +66,36 @@ -- | DSL reference to hydra.lib.logic.and and :: Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool-and arg0 arg1 =+and p q = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.logic.and")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm p)})),+ Core.applicationArgument = (Typed.unTypedTerm q)})) -- | DSL reference to hydra.lib.logic.ifElse ifElse :: Typed.TypedTerm Bool -> Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm x-ifElse arg0 arg1 arg2 =+ifElse p t f = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.logic.ifElse")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))+ Core.applicationArgument = (Typed.unTypedTerm p)})),+ Core.applicationArgument = (Typed.unTypedTerm t)})),+ Core.applicationArgument = (Typed.unTypedTerm f)})) -- | DSL reference to hydra.lib.logic.not not :: Typed.TypedTerm Bool -> Typed.TypedTerm Bool-not arg0 =+not p = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.logic.not")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm p)})) -- | DSL reference to hydra.lib.logic.or or :: Typed.TypedTerm Bool -> Typed.TypedTerm Bool -> Typed.TypedTerm Bool-or arg0 arg1 =+or p q = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.logic.or")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm p)})),+ Core.applicationArgument = (Typed.unTypedTerm q)}))
src/main/haskell/Hydra/Dsl/Lib/Maps.hs view
@@ -67,50 +67,50 @@ -- | 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 arg0 arg1 arg2 =+alter f k m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.alter")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm k)})),+ 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 arg0 arg1 arg2 =+bimap fk fv m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.bimap")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))+ Core.applicationArgument = (Typed.unTypedTerm fk)})),+ Core.applicationArgument = (Typed.unTypedTerm fv)})),+ 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 arg0 arg1 =+delete k m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.delete")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm k)})),+ 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 arg0 arg1 =+difference m1 m2 = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.difference")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm m1)})),+ 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 arg0 =+elems m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.elems")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm m)})) -- | DSL reference to hydra.lib.maps.empty empty :: Ord k => (Typed.TypedTerm (M.Map k v))@@ -118,145 +118,145 @@ -- | 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 arg0 arg1 =+filter p m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.filter")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm p)})),+ 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 arg0 arg1 =+filterWithKey p m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.filterWithKey")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm p)})),+ 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 arg0 arg1 arg2 =+findWithDefault def k m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.findWithDefault")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))+ Core.applicationArgument = (Typed.unTypedTerm def)})),+ Core.applicationArgument = (Typed.unTypedTerm k)})),+ 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 arg0 =+fromList xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.fromList")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ 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 arg0 arg1 arg2 =+insert k v m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.insert")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))+ Core.applicationArgument = (Typed.unTypedTerm k)})),+ Core.applicationArgument = (Typed.unTypedTerm v)})),+ 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 arg0 arg1 =+intersection m1 m2 = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.intersection")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm m1)})),+ Core.applicationArgument = (Typed.unTypedTerm m2)})) -- | DSL reference to hydra.lib.maps.keys keys :: Ord k => (Typed.TypedTerm (M.Map k v) -> Typed.TypedTerm [k])-keys arg0 =+keys m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.keys")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ 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 arg0 arg1 =+lookup k m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.lookup")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm k)})),+ 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 arg0 arg1 =+map f m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.map")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ 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 arg0 arg1 =+mapKeys f m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.mapKeys")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ 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 arg0 arg1 =+member k m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.member")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ 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 arg0 =+null m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.null")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ 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 arg0 arg1 =+singleton k v = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.singleton")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm k)})),+ 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 arg0 =+size m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.size")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ 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 arg0 =+toList m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.toList")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ 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 arg0 arg1 =+union m1 m2 = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.union")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm m1)})),+ 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 arg0 =+unions ms = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.maps.unions")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm ms)}))
src/main/haskell/Hydra/Dsl/Lib/Math.hs view
@@ -66,27 +66,27 @@ -- | DSL reference to hydra.lib.math.abs abs :: Typed.TypedTerm Int -> Typed.TypedTerm Int-abs arg0 =+abs x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.abs")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.acos acos :: Typed.TypedTerm Double -> Typed.TypedTerm Double-acos arg0 =+acos x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.acos")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.acosh acosh :: Typed.TypedTerm Double -> Typed.TypedTerm Double-acosh arg0 =+acosh x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.acosh")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.add-add :: Typed.TypedTerm Int -> Typed.TypedTerm Int -> Typed.TypedTerm Int+add :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm x add arg0 arg1 = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -96,173 +96,132 @@ -- | DSL reference to hydra.lib.math.addFloat64 addFloat64 :: Typed.TypedTerm Double -> Typed.TypedTerm Double -> Typed.TypedTerm Double-addFloat64 arg0 arg1 =+addFloat64 x y = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.addFloat64")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ Core.applicationArgument = (Typed.unTypedTerm y)})) -- | DSL reference to hydra.lib.math.asin asin :: Typed.TypedTerm Double -> Typed.TypedTerm Double-asin arg0 =+asin x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.asin")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.asinh asinh :: Typed.TypedTerm Double -> Typed.TypedTerm Double-asinh arg0 =+asinh x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.asinh")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.atan atan :: Typed.TypedTerm Double -> Typed.TypedTerm Double-atan arg0 =+atan x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.atan")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.atan2 atan2 :: Typed.TypedTerm Double -> Typed.TypedTerm Double -> Typed.TypedTerm Double-atan2 arg0 arg1 =+atan2 y x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.atan2")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm y)})),+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.atanh atanh :: Typed.TypedTerm Double -> Typed.TypedTerm Double-atanh arg0 =+atanh x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.atanh")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.ceiling ceiling :: Typed.TypedTerm Double -> Typed.TypedTerm Double-ceiling arg0 =+ceiling x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.ceiling")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.cos cos :: Typed.TypedTerm Double -> Typed.TypedTerm Double-cos arg0 =+cos x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.cos")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.cosh cosh :: Typed.TypedTerm Double -> Typed.TypedTerm Double-cosh arg0 =+cosh x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.cosh")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) +-- | DSL reference to hydra.lib.math.div+div :: Typed.TypedTerm Int -> Typed.TypedTerm Int -> Typed.TypedTerm (Maybe Int)+div x y =+ Typed.TypedTerm (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.div")),+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ Core.applicationArgument = (Typed.unTypedTerm y)}))+ -- | DSL reference to hydra.lib.math.e e :: Typed.TypedTerm Double e = Typed.TypedTerm (Core.TermVariable (Core.Name "hydra.lib.math.e")) -- | DSL reference to hydra.lib.math.even even :: Typed.TypedTerm Int -> Typed.TypedTerm Bool-even arg0 =+even x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.even")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.exp exp :: Typed.TypedTerm Double -> Typed.TypedTerm Double-exp arg0 =+exp x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.exp")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.floor floor :: Typed.TypedTerm Double -> Typed.TypedTerm Double-floor arg0 =+floor x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.floor")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.log log :: Typed.TypedTerm Double -> Typed.TypedTerm Double-log arg0 =+log x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.log")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.logBase logBase :: Typed.TypedTerm Double -> Typed.TypedTerm Double -> Typed.TypedTerm Double-logBase arg0 arg1 =+logBase b x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.logBase")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lib.math.max-max :: Typed.TypedTerm Int -> Typed.TypedTerm Int -> Typed.TypedTerm Int-max arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.max")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lib.math.maybeDiv-maybeDiv :: Typed.TypedTerm Int -> Typed.TypedTerm Int -> Typed.TypedTerm (Maybe Int)-maybeDiv arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.maybeDiv")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lib.math.maybeMod-maybeMod :: Typed.TypedTerm Int -> Typed.TypedTerm Int -> Typed.TypedTerm (Maybe Int)-maybeMod arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.maybeMod")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lib.math.maybePred-maybePred :: Typed.TypedTerm Int -> Typed.TypedTerm (Maybe Int)-maybePred arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.maybePred")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.lib.math.maybeRem-maybeRem :: Typed.TypedTerm Int -> Typed.TypedTerm Int -> Typed.TypedTerm (Maybe Int)-maybeRem arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.maybeRem")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))---- | DSL reference to hydra.lib.math.maybeSucc-maybeSucc :: Typed.TypedTerm Int -> Typed.TypedTerm (Maybe Int)-maybeSucc arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.maybeSucc")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm b)})),+ Core.applicationArgument = (Typed.unTypedTerm x)})) --- | DSL reference to hydra.lib.math.min-min :: Typed.TypedTerm Int -> Typed.TypedTerm Int -> Typed.TypedTerm Int-min arg0 arg1 =+-- | DSL reference to hydra.lib.math.mod+mod :: Typed.TypedTerm Int -> Typed.TypedTerm Int -> Typed.TypedTerm (Maybe Int)+mod x y = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.min")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mod")),+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ Core.applicationArgument = (Typed.unTypedTerm y)})) -- | DSL reference to hydra.lib.math.mul-mul :: Typed.TypedTerm Int -> Typed.TypedTerm Int -> Typed.TypedTerm Int+mul :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm x mul arg0 arg1 = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -272,15 +231,15 @@ -- | DSL reference to hydra.lib.math.mulFloat64 mulFloat64 :: Typed.TypedTerm Double -> Typed.TypedTerm Double -> Typed.TypedTerm Double-mulFloat64 arg0 arg1 =+mulFloat64 x y = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mulFloat64")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ Core.applicationArgument = (Typed.unTypedTerm y)})) -- | DSL reference to hydra.lib.math.negate-negate :: Typed.TypedTerm Int -> Typed.TypedTerm Int+negate :: Typed.TypedTerm x -> Typed.TypedTerm x negate arg0 = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.negate")),@@ -288,17 +247,17 @@ -- | DSL reference to hydra.lib.math.negateFloat64 negateFloat64 :: Typed.TypedTerm Double -> Typed.TypedTerm Double-negateFloat64 arg0 =+negateFloat64 x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.negateFloat64")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.odd odd :: Typed.TypedTerm Int -> Typed.TypedTerm Bool-odd arg0 =+odd x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.odd")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.pi pi :: Typed.TypedTerm Double@@ -306,77 +265,86 @@ -- | DSL reference to hydra.lib.math.pow pow :: Typed.TypedTerm Double -> Typed.TypedTerm Double -> Typed.TypedTerm Double-pow arg0 arg1 =+pow x y = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.pow")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ Core.applicationArgument = (Typed.unTypedTerm y)})) -- | DSL reference to hydra.lib.math.range range :: Typed.TypedTerm Int -> Typed.TypedTerm Int -> Typed.TypedTerm [Int]-range arg0 arg1 =+range a b = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.range")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm a)})),+ Core.applicationArgument = (Typed.unTypedTerm b)})) +-- | DSL reference to hydra.lib.math.rem+rem :: Typed.TypedTerm Int -> Typed.TypedTerm Int -> Typed.TypedTerm (Maybe Int)+rem x y =+ Typed.TypedTerm (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.rem")),+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ Core.applicationArgument = (Typed.unTypedTerm y)}))+ -- | DSL reference to hydra.lib.math.round round :: Typed.TypedTerm Double -> Typed.TypedTerm Double-round arg0 =+round x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.round")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.roundFloat32 roundFloat32 :: Typed.TypedTerm Int -> Typed.TypedTerm Float -> Typed.TypedTerm Float-roundFloat32 arg0 arg1 =+roundFloat32 n x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.roundFloat32")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm n)})),+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.roundFloat64 roundFloat64 :: Typed.TypedTerm Int -> Typed.TypedTerm Double -> Typed.TypedTerm Double-roundFloat64 arg0 arg1 =+roundFloat64 n x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.roundFloat64")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm n)})),+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.signum signum :: Typed.TypedTerm Int -> Typed.TypedTerm Int-signum arg0 =+signum x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.signum")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.sin sin :: Typed.TypedTerm Double -> Typed.TypedTerm Double-sin arg0 =+sin x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.sin")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.sinh sinh :: Typed.TypedTerm Double -> Typed.TypedTerm Double-sinh arg0 =+sinh x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.sinh")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.sqrt sqrt :: Typed.TypedTerm Double -> Typed.TypedTerm Double-sqrt arg0 =+sqrt x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.sqrt")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.sub-sub :: Typed.TypedTerm Int -> Typed.TypedTerm Int -> Typed.TypedTerm Int+sub :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm x sub arg0 arg1 = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -386,30 +354,30 @@ -- | DSL reference to hydra.lib.math.subFloat64 subFloat64 :: Typed.TypedTerm Double -> Typed.TypedTerm Double -> Typed.TypedTerm Double-subFloat64 arg0 arg1 =+subFloat64 x y = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.subFloat64")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ Core.applicationArgument = (Typed.unTypedTerm y)})) -- | DSL reference to hydra.lib.math.tan tan :: Typed.TypedTerm Double -> Typed.TypedTerm Double-tan arg0 =+tan x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.tan")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.tanh tanh :: Typed.TypedTerm Double -> Typed.TypedTerm Double-tanh arg0 =+tanh x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.tanh")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.math.truncate truncate :: Typed.TypedTerm Double -> Typed.TypedTerm Double-truncate arg0 =+truncate x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.truncate")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)}))
src/main/haskell/Hydra/Dsl/Lib/Optionals.hs view
@@ -67,147 +67,131 @@ -- | DSL reference to hydra.lib.optionals.apply apply :: Typed.TypedTerm (Maybe (x -> y)) -> Typed.TypedTerm (Maybe x) -> Typed.TypedTerm (Maybe y)-apply arg0 arg1 =+apply mf mx = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.apply")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm mf)})),+ Core.applicationArgument = (Typed.unTypedTerm mx)})) -- | DSL reference to hydra.lib.optionals.bind bind :: Typed.TypedTerm (Maybe x) -> Typed.TypedTerm (x -> Maybe y) -> Typed.TypedTerm (Maybe y)-bind arg0 arg1 =+bind m f = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.bind")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm m)})),+ Core.applicationArgument = (Typed.unTypedTerm f)})) -- | DSL reference to hydra.lib.optionals.cases cases :: Typed.TypedTerm (Maybe x) -> Typed.TypedTerm y -> Typed.TypedTerm (x -> y) -> Typed.TypedTerm y-cases arg0 arg1 arg2 =+cases m def f = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.cases")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.lib.optionals.cat-cat :: Typed.TypedTerm [Maybe x] -> Typed.TypedTerm [x]-cat arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.cat")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm m)})),+ Core.applicationArgument = (Typed.unTypedTerm def)})),+ Core.applicationArgument = (Typed.unTypedTerm f)})) -- | DSL reference to hydra.lib.optionals.compose compose :: Typed.TypedTerm (x -> Maybe y) -> Typed.TypedTerm (y -> Maybe z) -> Typed.TypedTerm x -> Typed.TypedTerm (Maybe z)-compose arg0 arg1 arg2 =+compose f g x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.compose")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm g)})),+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.optionals.foldList foldList :: Typed.TypedTerm (x -> y -> Maybe x) -> Typed.TypedTerm x -> Typed.TypedTerm [y] -> Typed.TypedTerm (Maybe x)-foldList arg0 arg1 arg2 =+foldList f acc xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.foldList")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))---- | DSL reference to hydra.lib.optionals.fromOptional-fromOptional :: Typed.TypedTerm x -> Typed.TypedTerm (Maybe x) -> Typed.TypedTerm x-fromOptional arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.fromOptional")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm acc)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.optionals.givens givens :: Typed.TypedTerm [Maybe x] -> Typed.TypedTerm [x]-givens arg0 =+givens xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.givens")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.optionals.isGiven isGiven :: Typed.TypedTerm (Maybe x) -> Typed.TypedTerm Bool-isGiven arg0 =+isGiven m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.isGiven")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm m)})) -- | DSL reference to hydra.lib.optionals.isNone isNone :: Typed.TypedTerm (Maybe x) -> Typed.TypedTerm Bool-isNone arg0 =+isNone m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.isNone")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm m)})) -- | DSL reference to hydra.lib.optionals.map map :: Typed.TypedTerm (x -> y) -> Typed.TypedTerm (Maybe x) -> Typed.TypedTerm (Maybe y)-map arg0 arg1 =+map f m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.map")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm m)})) -- | DSL reference to hydra.lib.optionals.mapList mapList :: Typed.TypedTerm (x -> Maybe y) -> Typed.TypedTerm [x] -> Typed.TypedTerm (Maybe [y])-mapList arg0 arg1 =+mapList f xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.mapList")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.optionals.mapOptional mapOptional :: Typed.TypedTerm (x -> Maybe y) -> Typed.TypedTerm [x] -> Typed.TypedTerm [y]-mapOptional arg0 arg1 =+mapOptional f xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.mapOptional")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ 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 arg0 arg1 =+mapSet f s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.mapSet")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.optionals.pure pure :: Typed.TypedTerm x -> Typed.TypedTerm (Maybe x)-pure arg0 =+pure x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.pure")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.optionals.toList toList :: Typed.TypedTerm (Maybe x) -> Typed.TypedTerm [x]-toList arg0 =+toList m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.toList")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm m)})) -- | DSL reference to hydra.lib.optionals.withDefault withDefault :: Typed.TypedTerm x -> Typed.TypedTerm (Maybe x) -> Typed.TypedTerm x-withDefault arg0 arg1 =+withDefault def m = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.withDefault")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm def)})),+ Core.applicationArgument = (Typed.unTypedTerm m)}))
+ src/main/haskell/Hydra/Dsl/Lib/Ordering.hs view
@@ -0,0 +1,128 @@+-- Note: this is an automatically generated file. Do not edit.++-- | DSL functions for hydra.lib.ordering++module Hydra.Dsl.Lib.Ordering 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.Dsl.Ast as DslAst+import qualified Hydra.Dsl.Coders as DslCoders+import qualified Hydra.Dsl.Core as DslCore+import qualified Hydra.Dsl.Docs as DslDocs+import qualified Hydra.Dsl.Error.Checking as ErrorChecking+import qualified Hydra.Dsl.Error.Core as DslErrorCore+import qualified Hydra.Dsl.Error.File as DslErrorFile+import qualified Hydra.Dsl.Error.Packaging as DslErrorPackaging+import qualified Hydra.Dsl.Error.System as DslErrorSystem+import qualified Hydra.Dsl.Errors as DslErrors+import qualified Hydra.Dsl.File as DslFile+import qualified Hydra.Dsl.Graph as DslGraph+import qualified Hydra.Dsl.Json.Model as JsonModel+import qualified Hydra.Dsl.Packaging as DslPackaging+import qualified Hydra.Dsl.Parsing as DslParsing+import qualified Hydra.Dsl.Paths as DslPaths+import qualified Hydra.Dsl.Query as DslQuery+import qualified Hydra.Dsl.Regex as DslRegex+import qualified Hydra.Dsl.Relational as DslRelational+import qualified Hydra.Dsl.System as DslSystem+import qualified Hydra.Dsl.Tabular as DslTabular+import qualified Hydra.Dsl.Testing as DslTesting+import qualified Hydra.Dsl.Time as DslTime+import qualified Hydra.Dsl.Topology as DslTopology+import qualified Hydra.Dsl.Typing as DslTyping+import qualified Hydra.Dsl.Util as DslUtil+import qualified Hydra.Dsl.Validation as DslValidation+import qualified Hydra.Dsl.Variants as DslVariants+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.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.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, map, pure, sum)+import qualified Data.Scientific as Sci++-- | DSL reference to hydra.lib.ordering.compare+compare :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Util.Comparison+compare x y =+ Typed.TypedTerm (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.ordering.compare")),+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ Core.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.lib.ordering.gt+gt :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Bool+gt x y =+ Typed.TypedTerm (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.ordering.gt")),+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ Core.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.lib.ordering.gte+gte :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Bool+gte x y =+ Typed.TypedTerm (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.ordering.gte")),+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ Core.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.lib.ordering.lt+lt :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Bool+lt x y =+ Typed.TypedTerm (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.ordering.lt")),+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ Core.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.lib.ordering.lte+lte :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm Bool+lte x y =+ Typed.TypedTerm (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.ordering.lte")),+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ Core.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.lib.ordering.max+max :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm x+max x y =+ Typed.TypedTerm (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.ordering.max")),+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ Core.applicationArgument = (Typed.unTypedTerm y)}))++-- | DSL reference to hydra.lib.ordering.min+min :: Typed.TypedTerm x -> Typed.TypedTerm x -> Typed.TypedTerm x+min x y =+ Typed.TypedTerm (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.ordering.min")),+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ Core.applicationArgument = (Typed.unTypedTerm y)}))
src/main/haskell/Hydra/Dsl/Lib/Pairs.hs view
@@ -66,25 +66,25 @@ -- | DSL reference to hydra.lib.pairs.bimap bimap :: Typed.TypedTerm (a -> c) -> Typed.TypedTerm (b -> d) -> Typed.TypedTerm (a, b) -> Typed.TypedTerm (c, d)-bimap arg0 arg1 arg2 =+bimap f g p = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.pairs.bimap")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ Core.applicationArgument = (Typed.unTypedTerm g)})),+ Core.applicationArgument = (Typed.unTypedTerm p)})) -- | DSL reference to hydra.lib.pairs.first first :: Typed.TypedTerm (a, b) -> Typed.TypedTerm a-first arg0 =+first p = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.pairs.first")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm p)})) -- | DSL reference to hydra.lib.pairs.second second :: Typed.TypedTerm (a, b) -> Typed.TypedTerm b-second arg0 =+second p = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.pairs.second")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm p)}))
src/main/haskell/Hydra/Dsl/Lib/Regex.hs view
@@ -66,58 +66,58 @@ -- | DSL reference to hydra.lib.regex.find find :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm (Maybe String)-find arg0 arg1 =+find pat s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.regex.find")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm pat)})),+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.regex.findAll findAll :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm [String]-findAll arg0 arg1 =+findAll pat s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.regex.findAll")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm pat)})),+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.regex.matches matches :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm Bool-matches arg0 arg1 =+matches pat s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.regex.matches")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm pat)})),+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.regex.replace replace :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm String-replace arg0 arg1 arg2 =+replace pat repl s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.regex.replace")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))+ Core.applicationArgument = (Typed.unTypedTerm pat)})),+ Core.applicationArgument = (Typed.unTypedTerm repl)})),+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.regex.replaceAll replaceAll :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm String-replaceAll arg0 arg1 arg2 =+replaceAll pat repl s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.regex.replaceAll")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)})),- Core.applicationArgument = (Typed.unTypedTerm arg2)}))+ Core.applicationArgument = (Typed.unTypedTerm pat)})),+ Core.applicationArgument = (Typed.unTypedTerm repl)})),+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.regex.split split :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm [String]-split arg0 arg1 =+split pat s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.regex.split")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm pat)})),+ Core.applicationArgument = (Typed.unTypedTerm s)}))
src/main/haskell/Hydra/Dsl/Lib/Sets.hs view
@@ -67,21 +67,21 @@ -- | DSL reference to hydra.lib.sets.delete delete :: Ord x => (Typed.TypedTerm x -> Typed.TypedTerm (S.Set x) -> Typed.TypedTerm (S.Set x))-delete arg0 arg1 =+delete x s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.delete")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ 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 arg0 arg1 =+difference s1 s2 = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.difference")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm s1)})),+ Core.applicationArgument = (Typed.unTypedTerm s2)})) -- | DSL reference to hydra.lib.sets.empty empty :: Ord x => (Typed.TypedTerm (S.Set x))@@ -89,96 +89,96 @@ -- | 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 arg0 arg1 =+filter predicate s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.filter")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm predicate)})),+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.sets.fromList fromList :: Ord x => (Typed.TypedTerm [x] -> Typed.TypedTerm (S.Set x))-fromList arg0 =+fromList xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.fromList")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ 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 arg0 arg1 =+insert x s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.insert")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})),+ 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 arg0 arg1 =+intersection s1 s2 = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.intersection")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm s1)})),+ Core.applicationArgument = (Typed.unTypedTerm s2)})) -- | 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 arg0 arg1 =+map f s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.map")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm f)})),+ 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 arg0 arg1 =+member x s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.member")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ 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 arg0 =+null s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.null")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.sets.singleton singleton :: Ord x => (Typed.TypedTerm x -> Typed.TypedTerm (S.Set x))-singleton arg0 =+singleton x = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.singleton")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm x)})) -- | DSL reference to hydra.lib.sets.size size :: Ord x => (Typed.TypedTerm (S.Set x) -> Typed.TypedTerm Int)-size arg0 =+size s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.size")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.sets.toList toList :: Ord x => (Typed.TypedTerm (S.Set x) -> Typed.TypedTerm [x])-toList arg0 =+toList s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.toList")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ 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 arg0 arg1 =+union s1 s2 = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.union")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm s1)})),+ 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 arg0 =+unions ss = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.sets.unions")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm ss)}))
src/main/haskell/Hydra/Dsl/Lib/Strings.hs view
@@ -64,135 +64,101 @@ import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, map, pure, sum) import qualified Data.Scientific as Sci --- | DSL reference to hydra.lib.strings.cat-cat :: Typed.TypedTerm [String] -> Typed.TypedTerm String-cat arg0 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.cat")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.lib.strings.cat2-cat2 :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm String-cat2 arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.cat2")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))- -- | DSL reference to hydra.lib.strings.charAt charAt :: Typed.TypedTerm Int -> Typed.TypedTerm String -> Typed.TypedTerm (Maybe Int)-charAt arg0 arg1 =+charAt i s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.charAt")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm i)})),+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.strings.concat concat :: Typed.TypedTerm [String] -> Typed.TypedTerm String-concat arg0 =+concat xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.concat")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.strings.concat2 concat2 :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm String-concat2 arg0 arg1 =+concat2 s t = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.concat2")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})),+ Core.applicationArgument = (Typed.unTypedTerm t)})) -- | DSL reference to hydra.lib.strings.fromList fromList :: Typed.TypedTerm [Int] -> Typed.TypedTerm String-fromList arg0 =+fromList cs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.fromList")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.lib.strings.intercalate-intercalate :: Typed.TypedTerm String -> Typed.TypedTerm [String] -> Typed.TypedTerm String-intercalate arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.intercalate")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm cs)})) -- | DSL reference to hydra.lib.strings.join join :: Typed.TypedTerm String -> Typed.TypedTerm [String] -> Typed.TypedTerm String-join arg0 arg1 =+join sep xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.join")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm sep)})),+ Core.applicationArgument = (Typed.unTypedTerm xs)})) -- | DSL reference to hydra.lib.strings.length length :: Typed.TypedTerm String -> Typed.TypedTerm Int-length arg0 =+length s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.length")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.strings.lines lines :: Typed.TypedTerm String -> Typed.TypedTerm [String]-lines arg0 =+lines s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.lines")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))---- | DSL reference to hydra.lib.strings.maybeCharAt-maybeCharAt :: Typed.TypedTerm Int -> Typed.TypedTerm String -> Typed.TypedTerm (Maybe Int)-maybeCharAt arg0 arg1 =- Typed.TypedTerm (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.maybeCharAt")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.strings.null null :: Typed.TypedTerm String -> Typed.TypedTerm Bool-null arg0 =+null s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.null")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.strings.splitOn splitOn :: Typed.TypedTerm String -> Typed.TypedTerm String -> Typed.TypedTerm [String]-splitOn arg0 arg1 =+splitOn sep s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.splitOn")),- Core.applicationArgument = (Typed.unTypedTerm arg0)})),- Core.applicationArgument = (Typed.unTypedTerm arg1)}))+ Core.applicationArgument = (Typed.unTypedTerm sep)})),+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.strings.toList toList :: Typed.TypedTerm String -> Typed.TypedTerm [Int]-toList arg0 =+toList s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.toList")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.strings.toLower toLower :: Typed.TypedTerm String -> Typed.TypedTerm String-toLower arg0 =+toLower s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.toLower")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.strings.toUpper toUpper :: Typed.TypedTerm String -> Typed.TypedTerm String-toUpper arg0 =+toUpper s = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.toUpper")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm s)})) -- | DSL reference to hydra.lib.strings.unlines unlines :: Typed.TypedTerm [String] -> Typed.TypedTerm String-unlines arg0 =+unlines xs = Typed.TypedTerm (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.strings.unlines")),- Core.applicationArgument = (Typed.unTypedTerm arg0)}))+ Core.applicationArgument = (Typed.unTypedTerm xs)}))
src/main/haskell/Hydra/Dsls.hs view
@@ -91,7 +91,7 @@ -- | Transform a source module into a DSL module dslModule :: t0 -> Graph.Graph -> Packaging.Module -> Either Errors.Error (Maybe Packaging.Module) dslModule cx graph mod =- Eithers.bind (filterTypeBindings cx graph (Optionals.cat (Lists.map (\d -> case d of+ Eithers.bind (filterTypeBindings cx graph (Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionType v0 -> Just ((\name -> \typ -> let schemaTerm = Core.TermVariable (Core.Name "hydra.core.Type") dataTerm =@@ -111,7 +111,7 @@ in (Logic.ifElse (Lists.null allBindings) (Right Nothing) (Right (Just (Packaging.Module { Packaging.moduleName = (dslModuleName (Packaging.moduleName mod)), Packaging.moduleMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just (Strings.cat [+ Packaging.entityMetadataDescription = (Just (Strings.concat [ "DSL functions for ", (Packaging.unModuleName (Packaging.moduleName mod))])), Packaging.entityMetadataComments = [],@@ -119,7 +119,7 @@ Packaging.entityMetadataLifecycle = Nothing})), Packaging.moduleDependencies = (Lists.map (\ns -> Packaging.ModuleDependency { Packaging.moduleDependencyModule = ns,- Packaging.moduleDependencyPackage = Nothing}) (Lists.nub (Lists.concat2 [+ Packaging.moduleDependencyPackage = Nothing}) (Lists.distinct (Lists.concat2 [ Packaging.moduleName mod, (Packaging.ModuleName "hydra.typed"), (Names.derivedModuleName [@@ -186,7 +186,7 @@ -- | Filter bindings to only DSL-eligible type definitions filterTypeBindings :: t0 -> t1 -> [Core.Binding] -> Either t2 [Core.Binding] filterTypeBindings cx graph bindings =- Eithers.map Optionals.cat (Eithers.mapList (isDslEligibleBinding cx graph) (Lists.filter Annotations.isNativeType bindings))+ Eithers.map Optionals.givens (Eithers.mapList (isDslEligibleBinding cx graph) (Lists.filter Annotations.isNativeType bindings)) -- | Generate all DSL bindings for a type binding generateBindingsForType :: t0 -> Graph.Graph -> Core.Binding -> Either Errors.DecodingError [Core.Binding]@@ -225,7 +225,7 @@ let vars = collectForallVars origType localName = Names.localNameOf typeName builderLocalName =- Strings.cat [+ Strings.concat [ "encode", localName] builderName = dslDefinitionName typeName builderLocalName@@ -273,7 +273,7 @@ Core.lambdaDomain = (Just (Pairs.second pp)), Core.lambdaBody = acc})) builderTerm (Lists.reverse paramPairs) description =- Strings.cat [+ Strings.concat [ "DSL composition builder for the ", "encode", "r of ",@@ -296,7 +296,7 @@ let vars = collectForallVars origType localName = Names.localNameOf typeName builderLocalName =- Strings.cat [+ Strings.concat [ "decode", localName] builderName = dslDefinitionName typeName builderLocalName@@ -348,7 +348,7 @@ Core.lambdaDomain = (Just (Pairs.second pp)), Core.lambdaBody = acc})) builderTerm (Lists.reverse paramPairs) description =- Strings.cat [+ Strings.concat [ "DSL composition builder for the ", "decode", "r of ",@@ -382,9 +382,9 @@ let fieldName = Core.fieldTypeName ft accessorLocalName =- Strings.cat [+ Strings.concat [ Formatting.decapitalize (Names.localNameOf typeName),- (Strings.intercalate "" (Lists.map (\s -> Formatting.capitalize s) (Strings.splitOn "." (Core.unName fieldName))))]+ (Strings.join "" (Lists.map (\s -> Formatting.capitalize s) (Strings.splitOn "." (Core.unName fieldName))))] accessorName = dslDefinitionName typeName accessorLocalName paramDomain = Core.TypeApplication (Core.ApplicationType {@@ -428,7 +428,7 @@ Core.applicationFunction = (Core.TermUnwrap (Core.Name "hydra.typed.TypedTerm")), Core.applicationArgument = (Core.TermVariable (Core.Name "x"))}))}]}))}}))}))}) description =- Strings.cat [+ Strings.concat [ "DSL accessor for the ", (Core.unName fieldName), " field of ",@@ -489,7 +489,7 @@ Core.lambdaDomain = (Just (Pairs.second pp)), Core.lambdaBody = acc})) recordTerm (Lists.reverse paramPairs) description =- Strings.cat [+ Strings.concat [ "DSL constructor for ", (Core.unName typeName)] body = Annotations.setTermDescription (Just description) rawBody@@ -508,10 +508,10 @@ let targetFieldName = Core.fieldTypeName targetField updaterLocalName =- Strings.cat [+ Strings.concat [ Formatting.decapitalize (Names.localNameOf typeName), "With",- (Strings.intercalate "" (Lists.map (\s -> Formatting.capitalize s) (Strings.splitOn "." (Core.unName targetFieldName))))]+ (Strings.join "" (Lists.map (\s -> Formatting.capitalize s) (Strings.splitOn "." (Core.unName targetFieldName))))] updaterName = dslDefinitionName typeName updaterLocalName dFields = Lists.map (\ft -> Core.TermRecord (Core.Record {@@ -590,7 +590,7 @@ Core.fieldName = (Core.Name "fields"), Core.fieldTerm = (Core.TermList dFields)}]}))}}))}))}))}) description =- Strings.cat [+ Strings.concat [ "DSL updater for the ", (Core.unName targetFieldName), " field of ",@@ -660,7 +660,7 @@ Core.lambdaDomain = (Just (Pairs.second pp)), Core.lambdaBody = acc})) refTerm (Lists.reverse paramPairs) description =- Strings.cat [+ Strings.concat [ "DSL reference to ", (Core.unName refName)] body = Annotations.setTermDescription (Just description) rawBody@@ -676,12 +676,12 @@ let localName = Names.localNameOf typeName tokenLocalName =- Strings.cat [+ Strings.concat [ Formatting.decapitalize localName, localName] tokenName = dslDefinitionName typeName tokenLocalName description =- Strings.cat [+ Strings.concat [ "DSL name token for ", (Core.unName typeName)] body =@@ -709,9 +709,9 @@ let fieldName = Core.fieldTypeName ft fieldType = Core.fieldTypeType ft injectorLocalName =- Strings.cat [+ Strings.concat [ Formatting.decapitalize (Names.localNameOf typeName),- (Strings.intercalate "" (Lists.map (\s -> Formatting.capitalize s) (Strings.splitOn "." (Core.unName fieldName))))]+ (Strings.join "" (Lists.map (\s -> Formatting.capitalize s) (Strings.splitOn "." (Core.unName fieldName))))] injectorName = dslDefinitionName typeName injectorLocalName isUnit = (\t -> case (Strip.deannotateType t) of@@ -763,7 +763,7 @@ Core.lambdaDomain = (Just variantDomain), Core.lambdaBody = injectionTerm})) description =- Strings.cat [+ Strings.concat [ "DSL injection for the ", (Core.unName fieldName), " variant of ",@@ -784,7 +784,7 @@ let localName = Names.localNameOf typeName wrapName = dslDefinitionName typeName (Formatting.decapitalize localName) unwrapLocalName =- Strings.cat [+ Strings.concat [ "un", localName] unwrapName = dslDefinitionName typeName unwrapLocalName@@ -817,7 +817,7 @@ Core.applicationFunction = (Core.TermUnwrap (Core.Name "hydra.typed.TypedTerm")), Core.applicationArgument = (Core.TermVariable (Core.Name "x"))}))}]}))}}))}))}) wrapDescription =- Strings.cat [+ Strings.concat [ "DSL constructor for the ", (Core.unName typeName), " wrapper"]@@ -854,7 +854,7 @@ Core.applicationFunction = (Core.TermUnwrap (Core.Name "hydra.typed.TypedTerm")), Core.applicationArgument = (Core.TermVariable (Core.Name "x"))}))}]}))}}))}))}) unwrapDescription =- Strings.cat [+ Strings.concat [ "DSL accessor for the body of ", (Core.unName typeName)] unwrapBody = Annotations.setTermDescription (Just unwrapDescription) rawUnwrapBody
src/main/haskell/Hydra/Encoding.hs view
@@ -57,7 +57,7 @@ Eithers.bind (DecodeCore.type_ graph (Core.bindingTerm b)) (\typ -> let rawBody = encodeTypeNamed (Core.bindingName b) typ description =- Strings.cat [+ Strings.concat [ "Encoder for ", (Core.unName (Core.bindingName b))] in (Right (Core.Binding {@@ -306,7 +306,7 @@ -- | Transform a type module into an encoder module encodeModule :: t0 -> Graph.Graph -> Packaging.Module -> Either Errors.Error (Maybe Packaging.Module) encodeModule cx graph mod =- Eithers.bind (filterTypeBindings cx graph (Optionals.cat (Lists.map (\d -> case d of+ Eithers.bind (filterTypeBindings cx graph (Optionals.givens (Lists.map (\d -> case d of Packaging.DefinitionType v0 -> Just ((\name -> \typ -> let schemaTerm = Core.TermVariable (Core.Name "hydra.core.Type") dataTerm =@@ -324,7 +324,7 @@ _ -> 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 { Packaging.moduleName = (encodeModuleName (Packaging.moduleName mod)), Packaging.moduleMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just (Strings.cat [+ Packaging.entityMetadataDescription = (Just (Strings.concat [ "Term encoders for ", (Packaging.unModuleName (Packaging.moduleName mod))])), Packaging.entityMetadataComments = [],@@ -332,7 +332,7 @@ Packaging.entityMetadataLifecycle = Nothing})), Packaging.moduleDependencies = (Lists.map (\ns -> Packaging.ModuleDependency { Packaging.moduleDependencyModule = ns,- Packaging.moduleDependencyPackage = Nothing}) (Lists.nub (Lists.concat2 (Lists.map encodeModuleName (Lists.map (\dep -> Packaging.moduleDependencyModule dep) (Packaging.moduleDependencies mod))) [+ Packaging.moduleDependencyPackage = Nothing}) (Lists.distinct (Lists.concat2 (Lists.map encodeModuleName (Lists.map (\dep -> Packaging.moduleDependencyModule dep) (Packaging.moduleDependencies mod))) [ Packaging.moduleName mod]))), Packaging.moduleDefinitions = (Lists.map (\b -> Packaging.DefinitionTerm (Packaging.TermDefinition { Packaging.termDefinitionName = (Core.bindingName b),@@ -742,7 +742,7 @@ let typeVars = encoderCollectForallVariables typ encoderFunType = encoderType typ allOrdVars = encoderCollectOrdVars typ- ordVars = Lists.filter (\v -> Lists.elem v typeVars) allOrdVars+ ordVars = Lists.filter (\v -> Lists.member v typeVars) allOrdVars constraints = Logic.ifElse (Lists.null ordVars) Nothing (Just (Maps.fromList (Lists.map (\v -> ( v,@@ -761,7 +761,7 @@ let typeVars = encoderCollectForallVariables typ encoderFunType = encoderTypeNamed ename typ allOrdVars = encoderCollectOrdVars typ- ordVars = Lists.filter (\v -> Lists.elem v typeVars) allOrdVars+ ordVars = Lists.filter (\v -> Lists.member v typeVars) allOrdVars constraints = Logic.ifElse (Lists.null ordVars) Nothing (Just (Maps.fromList (Lists.map (\v -> ( v,@@ -776,7 +776,7 @@ -- | Filter bindings to only encodable type definitions filterTypeBindings :: t0 -> Graph.Graph -> [Core.Binding] -> Either Errors.Error [Core.Binding] filterTypeBindings cx graph bindings =- Eithers.map Optionals.cat (Eithers.mapList (isEncodableBinding cx graph) (Lists.filter Annotations.isNativeType bindings))+ Eithers.map Optionals.givens (Eithers.mapList (isEncodableBinding cx graph) (Lists.filter Annotations.isNativeType bindings)) -- | Check if a binding is encodable (serializable type) isEncodableBinding :: t0 -> Graph.Graph -> Core.Binding -> Either Errors.Error (Maybe Core.Binding)
src/main/haskell/Hydra/Environment.hs view
@@ -93,7 +93,7 @@ Packaging.DefinitionType _ -> Nothing Packaging.DefinitionTerm v0 -> Just v0 Packaging.DefinitionPrimitive _ -> Nothing- in (Optionals.cat (Lists.map getType defs), (Optionals.cat (Lists.map getTerm defs)))+ in (Optionals.givens (Lists.map getType defs), (Optionals.givens (Lists.map getTerm defs))) -- | Reorder definitions: types first (with hydra.core.Name first among types), then topologically sorted terms reorderDefs :: [Packaging.Definition] -> [Packaging.Definition]@@ -146,7 +146,7 @@ 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)))- in (Eithers.map (\mpairs -> Maps.fromList (Optionals.cat mpairs)) (Eithers.mapList toPair (Lexical.graphToBindings g)))+ 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 termAsBindings :: Core.Term -> [Core.Binding]
src/main/haskell/Hydra/Extract/Core.hs view
@@ -98,7 +98,7 @@ cases name graph term0 = Eithers.bind (Lexical.stripAndDereferenceTerm graph term0) (\term -> case term of Core.TermCases v0 -> Logic.ifElse (Equality.equal (Core.unName (Core.caseStatementTypeName v0)) (Core.unName name)) (Right v0) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {- Errors.unexpectedShapeErrorExpected = (Strings.cat2 "case statement for type " (Core.unName name)),+ Errors.unexpectedShapeErrorExpected = (Strings.concat2 "case statement for type " (Core.unName name)), Errors.unexpectedShapeErrorActual = (PrintCore.term term)})))) _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError { Errors.unexpectedShapeErrorExpected = "case statement",@@ -193,11 +193,11 @@ let matchingFields = Lists.filter (\f -> Equality.equal (Core.unName (Core.fieldName f)) (Core.unName fname)) fields noMatchErr = Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {- Errors.unexpectedShapeErrorExpected = (Strings.cat2 "field " (Core.unName fname)),+ 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.cases (Lists.maybeHead 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.null matchingFields) noMatchErr (Logic.ifElse (Equality.equal (Lists.length matchingFields) 1) (Optionals.cases (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.cat2 "multiple fields named " (Core.unName fname))}))))))+ Errors.unexpectedShapeErrorActual = (Strings.concat2 "multiple fields named " (Core.unName fname))})))))) -- | Extract a 32-bit floating-point value from a term float32 :: Graph.Graph -> Core.Term -> Either Errors.Error Float@@ -254,7 +254,7 @@ injection expected graph term0 = Eithers.bind (Lexical.stripAndDereferenceTerm graph term0) (\term -> case term of Core.TermInject v0 -> Logic.ifElse (Equality.equal (Core.unName (Core.injectionTypeName v0)) (Core.unName expected)) (Right (Core.injectionField v0)) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {- Errors.unexpectedShapeErrorExpected = (Strings.cat2 "injection of type " (Core.unName expected)),+ Errors.unexpectedShapeErrorExpected = (Strings.concat2 "injection of type " (Core.unName expected)), Errors.unexpectedShapeErrorActual = (Core.unName (Core.injectionTypeName v0))})))) _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError { Errors.unexpectedShapeErrorExpected = "injection",@@ -358,7 +358,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.cases (Lists.maybeHead matchingBindings) noBindingErr (\b -> Right (Core.bindingTerm b))) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorMultipleBindings (Errors.MultipleBindingsError {+ in (Logic.ifElse (Lists.null matchingBindings) noBindingErr (Logic.ifElse (Equality.equal (Lists.length matchingBindings) 1) (Optionals.cases (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@@ -424,10 +424,10 @@ nArgs :: Core.Name -> Int -> [t0] -> Either Errors.Error () nArgs name n args = Logic.ifElse (Equality.equal (Lists.length args) n) (Right ()) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {- Errors.unexpectedShapeErrorExpected = (Strings.cat [+ Errors.unexpectedShapeErrorExpected = (Strings.concat [ Literals.showInt32 n, " arguments to primitive ",- (Literals.showString (Core.unName name))]),+ (Literals.printString (Core.unName name))]), Errors.unexpectedShapeErrorActual = (Literals.showInt32 (Lists.length args))})))) -- | Extract an optional value from a term, applying a function to the value if present@@ -463,7 +463,7 @@ record :: Core.Name -> Graph.Graph -> Core.Term -> Either Errors.Error [Core.Field] record expected graph term0 = Eithers.bind (termRecord graph term0) (\record -> Logic.ifElse (Equality.equal (Core.recordTypeName record) expected) (Right (Core.recordFields record)) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {- Errors.unexpectedShapeErrorExpected = (Strings.cat2 "record of type " (Core.unName expected)),+ Errors.unexpectedShapeErrorExpected = (Strings.concat2 "record of type " (Core.unName expected)), Errors.unexpectedShapeErrorActual = (Core.unName (Core.recordTypeName record))}))))) -- | Extract the field types from a record type@@ -480,7 +480,7 @@ -- | Require a field from a record's field map and decode it requireField :: String -> (t0 -> t1 -> Either Errors.DecodingError t2) -> M.Map Core.Name t1 -> t0 -> Either Errors.DecodingError t2 requireField fieldName decoder fieldMap g =- Optionals.cases (Maps.lookup (Core.Name fieldName) fieldMap) (Left (Errors.DecodingError (Strings.cat [+ Optionals.cases (Maps.lookup (Core.Name fieldName) fieldMap) (Left (Errors.DecodingError (Strings.concat [ "missing field ", fieldName, " in record"]))) (\fieldTerm -> decoder g fieldTerm)@@ -622,10 +622,10 @@ wrap expected graph term0 = Eithers.bind (Lexical.stripAndDereferenceTerm graph term0) (\term -> case term of Core.TermWrap v0 -> Logic.ifElse (Equality.equal (Core.unName (Core.wrappedTermTypeName v0)) (Core.unName expected)) (Right (Core.wrappedTermBody v0)) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {- Errors.unexpectedShapeErrorExpected = (Strings.cat2 "wrapper of type " (Core.unName expected)),+ Errors.unexpectedShapeErrorExpected = (Strings.concat2 "wrapper of type " (Core.unName expected)), Errors.unexpectedShapeErrorActual = (Core.unName (Core.wrappedTermTypeName v0))})))) _ -> Left (Errors.ErrorExtraction (Errors.ExtractionErrorUnexpectedShape (Errors.UnexpectedShapeError {- Errors.unexpectedShapeErrorExpected = (Strings.cat2 (Strings.cat2 "wrap(" (Core.unName expected)) ")"),+ Errors.unexpectedShapeErrorExpected = (Strings.concat2 (Strings.concat2 "wrap(" (Core.unName expected)) ")"), Errors.unexpectedShapeErrorActual = (PrintCore.term term)})))) -- | Extract the wrapped type from a wrapper type
src/main/haskell/Hydra/Extract/Json.hs view
@@ -47,28 +47,28 @@ expectArray value = case value of Model.ValueArray v0 -> Right v0- _ -> Left (Strings.cat2 (Strings.cat2 "expected " "JSON array") (Strings.cat2 " but found " (showValue value)))+ _ -> Left (Strings.concat2 (Strings.concat2 "expected " "JSON array") (Strings.concat2 " but found " (showValue value))) -- | Extract a number from a JSON value, failing if the value is not a number expectNumber :: Model.Value -> Either String Sci.Scientific expectNumber value = case value of Model.ValueNumber v0 -> Right v0- _ -> Left (Strings.cat2 (Strings.cat2 "expected " "JSON number") (Strings.cat2 " but found " (showValue value)))+ _ -> Left (Strings.concat2 (Strings.concat2 "expected " "JSON number") (Strings.concat2 " but found " (showValue value))) -- | Extract an object from a JSON value as a name-keyed map, failing if the value is not an object. Field order is not preserved; lookups are by name. expectObject :: Model.Value -> Either String (M.Map String Model.Value) expectObject value = case value of Model.ValueObject v0 -> Right (Maps.fromList v0)- _ -> Left (Strings.cat2 (Strings.cat2 "expected " "JSON object") (Strings.cat2 " but found " (showValue value)))+ _ -> Left (Strings.concat2 (Strings.concat2 "expected " "JSON object") (Strings.concat2 " but found " (showValue value))) -- | Extract a string from a JSON value, failing if the value is not a string expectString :: Model.Value -> Either String String expectString value = case value of Model.ValueString v0 -> Right v0- _ -> Left (Strings.cat2 (Strings.cat2 "expected " "JSON string") (Strings.cat2 " but found " (showValue value)))+ _ -> Left (Strings.concat2 (Strings.concat2 "expected " "JSON string") (Strings.concat2 " but found " (showValue value))) -- | Look up an optional field in a JSON object opt :: Ord t0 => (t0 -> M.Map t0 t1 -> Maybe t1)@@ -85,7 +85,7 @@ -- | Look up a required field in a JSON object, failing if not found require :: String -> M.Map String t0 -> Either String t0 require fname m =- Optionals.cases (Maps.lookup fname m) (Left (Strings.cat [+ Optionals.cases (Maps.lookup fname m) (Left (Strings.concat [ "required attribute ", (showValue (Model.ValueString fname)), " not found"])) (\value -> Right value)
src/main/haskell/Hydra/Formatting.hs view
@@ -24,6 +24,7 @@ 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+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@@ -61,7 +62,7 @@ let splitOnUppercase = \acc -> \c -> Lists.concat2 (Logic.ifElse (Chars.isUpper c) [- []] []) (Optionals.fromOptional acc (Optionals.map (\uc -> Lists.cons (Lists.cons c (Pairs.first uc)) (Pairs.second uc)) (Lists.uncons acc)))+ []] []) (Optionals.withDefault acc (Optionals.map (\uc -> Lists.cons (Lists.cons c (Pairs.first uc)) (Pairs.second uc)) (Lists.uncons acc))) in (Lists.map Strings.fromList (Lists.foldl splitOnUppercase [ []] (Lists.reverse (Strings.toList (decapitalize original))))) byUnderscores = Strings.splitOn "_" original@@ -71,10 +72,10 @@ Util.CaseConventionLowerSnake -> byUnderscores Util.CaseConventionUpperSnake -> byUnderscores in case to of- Util.CaseConventionCamel -> decapitalize (Strings.cat (Lists.map (\arg_ -> capitalize (Strings.toLower arg_)) parts))- Util.CaseConventionPascal -> Strings.cat (Lists.map (\arg_ -> capitalize (Strings.toLower arg_)) parts)- Util.CaseConventionLowerSnake -> Strings.intercalate "_" (Lists.map Strings.toLower parts)- Util.CaseConventionUpperSnake -> Strings.intercalate "_" (Lists.map Strings.toUpper parts)+ Util.CaseConventionCamel -> decapitalize (Strings.concat (Lists.map (\arg_ -> capitalize (Strings.toLower arg_)) parts))+ Util.CaseConventionPascal -> Strings.concat (Lists.map (\arg_ -> capitalize (Strings.toLower arg_)) parts)+ Util.CaseConventionLowerSnake -> Strings.join "_" (Lists.map Strings.toLower parts)+ Util.CaseConventionUpperSnake -> Strings.join "_" (Lists.map Strings.toUpper parts) -- | Convert a string from camel case (possibly with underscores) to lower snake case. Splits on underscores first, then converts each part from camel case. convertCaseCamelOrUnderscoreToLowerSnake :: String -> String@@ -82,7 +83,7 @@ let parts = Strings.splitOn "_" s snakeParts = Lists.map (\p -> convertCaseCamelToLowerSnake p) parts- in (Strings.intercalate "_" snakeParts)+ in (Strings.join "_" snakeParts) -- | Convert a string from camel case to lower snake case convertCaseCamelToLowerSnake :: String -> String@@ -102,34 +103,34 @@ -- | Escape reserved words by appending an underscore escapeWithUnderscore :: S.Set String -> String -> String-escapeWithUnderscore reserved s = Logic.ifElse (Sets.member s reserved) (Strings.cat2 s "_") s+escapeWithUnderscore reserved s = Logic.ifElse (Sets.member s reserved) (Strings.concat2 s "_") s -- | Indent each line of a string with four spaces indentLines :: String -> String indentLines s = - let indent = \l -> Strings.cat2 " " l+ let indent = \l -> Strings.concat2 " " l in (Strings.unlines (Lists.map indent (Strings.lines s))) -- | Format a string as a Java-style block comment javaStyleComment :: String -> String-javaStyleComment s = Strings.cat2 (Strings.cat2 (Strings.cat2 "/**\n" " * ") s) "\n */"+javaStyleComment s = Strings.concat2 (Strings.concat2 (Strings.concat2 "/**\n" " * ") s) "\n */" -- | 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 ( let list = Strings.toList s- in (Optionals.fromOptional s (Optionals.map (\uc ->+ in (Optionals.withDefault s (Optionals.map (\uc -> let firstLetter = mapping (Strings.fromList (Lists.pure (Pairs.first uc)))- in (Strings.cat2 firstLetter (Strings.fromList (Pairs.second uc)))) (Lists.uncons list))))+ in (Strings.concat2 firstLetter (Strings.fromList (Pairs.second uc)))) (Lists.uncons list)))) -- | Replace sequences of non-alphanumeric characters with single underscores nonAlnumToUnderscores :: String -> String nonAlnumToUnderscores input = let isAlnum =- \c -> Logic.or (Logic.and (Equality.gte c 65) (Equality.lte c 90)) (Logic.or (Logic.and (Equality.gte c 97) (Equality.lte c 122)) (Logic.and (Equality.gte c 48) (Equality.lte c 57)))+ \c -> Logic.or (Logic.and (Ordering.gte c 65) (Ordering.lte c 90)) (Logic.or (Logic.and (Ordering.gte c 97) (Ordering.lte c 122)) (Logic.and (Ordering.gte c 48) (Ordering.lte c 57))) replace = \p -> \c -> let s = Pairs.first p@@ -145,8 +146,8 @@ let stripped = stripLeadingAndTrailingWhitespace s in (Logic.ifElse (Strings.null stripped) "" ( let lastIdx = Math.sub (Strings.length stripped) 1- appended = Strings.cat2 stripped "."- in (Optionals.cases (Strings.maybeCharAt lastIdx stripped) appended (\lastChar -> Logic.ifElse (Equality.equal lastChar 46) stripped appended))))+ appended = Strings.concat2 stripped "."+ in (Optionals.cases (Strings.charAt lastIdx stripped) appended (\lastChar -> Logic.ifElse (Equality.equal lastChar 46) stripped appended)))) -- | Sanitize a string by replacing non-alphanumeric characters and escaping reserved words sanitizeWithUnderscores :: S.Set String -> String -> String@@ -155,9 +156,9 @@ -- | Format a list of elements as a bracketed, comma-separated string showList :: (t0 -> String) -> [t0] -> String showList f els =- Strings.cat [+ Strings.concat [ "[",- (Strings.intercalate ", " (Lists.map f els)),+ (Strings.join ", " (Lists.map f els)), "]"] -- | Remove leading and trailing whitespace from a string@@ -204,7 +205,7 @@ (124, "verbar"), (125, "rcub"), (126, "tilde")]- alias = \c -> Optionals.fromOptional (Lists.pure c) (Optionals.map Strings.toList (Maps.lookup c aliases))+ alias = \c -> Optionals.withDefault (Lists.pure 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@@ -218,6 +219,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 (Equality.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.fromOptional (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.maybeInit prefix)))))- in (Strings.fromList (Lists.intercalate [+ 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 (Strings.fromList (Lists.join [ 10] (helper [] (Strings.toList input))))
src/main/haskell/Hydra/Hoisting.hs view
@@ -26,6 +26,7 @@ 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+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@@ -74,7 +75,7 @@ \b -> let freeVars = Sets.toList (Sets.intersection boundVars (Variables.freeVariablesInTerm (Core.bindingTerm b))) varTypePairs = Lists.map (\v -> (v, (Maps.lookup v types))) freeVars- varTypes = Optionals.cat (Lists.map Pairs.second varTypePairs)+ 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) ( Core.Binding { Core.bindingName = (Core.bindingName b),@@ -91,7 +92,7 @@ Core.applicationFunction = t, Core.applicationArgument = (Core.TermVariable v)})) (Core.TermVariable (Core.bindingName b)) freeVars))))) results = Lists.map augment bindings- in (Lists.map Pairs.first results, (Typing.TermSubst (Maps.fromList (Optionals.cat (Lists.map Pairs.second results)))))+ in (Lists.map Pairs.first results, (Typing.TermSubst (Maps.fromList (Optionals.givens (Lists.map Pairs.second results))))) -- | Check if a binding has a polymorphic type (non-empty list of type scheme variables) bindingIsPolymorphic :: Core.Binding -> Bool@@ -174,18 +175,18 @@ types = Maps.map Scoping.typeSchemeToFType (Graph.graphBoundTypes cx) capturedTermVarTypePairs = Lists.map (\v -> (v, (Maps.lookup v types))) capturedTermVars capturedTermVarTypes =- Lists.map (\typ -> Strip.deannotateTypeParameters typ) (Optionals.cat (Lists.map Pairs.second capturedTermVarTypePairs))+ Lists.map (\typ -> Strip.deannotateTypeParameters typ) (Optionals.givens (Lists.map Pairs.second capturedTermVarTypePairs)) freeInBindingType = Optionals.cases (Core.bindingTypeScheme b) Sets.empty (\ts -> Variables.freeVariablesInType (Core.typeSchemeBody ts)) freeInCapturedVarTypes = Sets.unions (Lists.map (\t -> Variables.freeVariablesInType t) capturedTermVarTypes) capturedTypeVars = Sets.toList (Sets.intersection (Graph.graphTypeVariables cx) (Sets.union freeInBindingType freeInCapturedVarTypes)) globalBindingName =- Lexical.chooseUniqueName alreadyUsedNames (Core.Name (Strings.cat2 prefix (Core.unName (Core.bindingName b))))+ Lexical.chooseUniqueName alreadyUsedNames (Core.Name (Strings.concat2 prefix (Core.unName (Core.bindingName b)))) newUsedNames = Sets.insert globalBindingName alreadyUsedNames newTypeScheme = Logic.ifElse (Equality.equal (Lists.length capturedTermVarTypes) (Lists.length capturedTermVarTypePairs)) (Optionals.map (\ts -> Core.TypeScheme {- Core.typeSchemeVariables = (Lists.nub (Lists.concat2 capturedTypeVars (Core.typeSchemeVariables ts))),+ Core.typeSchemeVariables = (Lists.distinct (Lists.concat2 capturedTypeVars (Core.typeSchemeVariables ts))), Core.typeSchemeBody = (Lists.foldl (\t -> \a -> Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = a, Core.functionTypeCodomain = t})) (Core.typeSchemeBody ts) (Lists.reverse capturedTermVarTypes)),@@ -257,7 +258,7 @@ hoistBindingMap = Maps.fromList (Lists.map (\b -> (Core.bindingName b, b)) hoistUs) isCacheable = \name ->- let multiRef = Equality.gte (countVarOccurrences name body) 2+ let multiRef = Ordering.gte (countVarOccurrences name body) 2 isPoly = Optionals.cases (Maps.lookup name hoistBindingMap) False (\b -> bindingIsPolymorphic b) in (Logic.and multiRef (Logic.not isPoly)) singleRefPairs = Lists.filter (\p -> Logic.not (isCacheable (Pairs.first p))) hoistNameReplacementPairs@@ -302,7 +303,7 @@ cx1 = Scoping.extendGraphForLet (\c -> \b -> Nothing) cx0 let0 forActiveBinding = \b ->- let prefix = Strings.cat2 (Core.unName (Core.bindingName b)) "_"+ let prefix = Strings.concat2 (Core.unName (Core.bindingName b)) "_" init = ([], (Sets.singleton (Core.bindingName b))) resultPair = Rewriting.rewriteAndFoldTermWithGraph (rewrite prefix) cx1 init (Core.bindingTerm b) resultBindings = Pairs.first (Pairs.first resultPair)@@ -356,7 +357,7 @@ fullPath = Lists.concat2 pathPrefix path in (Logic.ifElse (shouldHoist (fullPath, processedTerm)) ( let proposedName =- Core.Name (Strings.cat [+ Core.Name (Strings.concat [ "_hoist_", namePrefix, "_",@@ -402,7 +403,7 @@ body = Core.letBody lt processBinding = \acc -> \binding ->- let namePrefix = Strings.intercalate "_" (Strings.splitOn "." (Core.unName (Core.bindingName binding)))+ let namePrefix = Strings.join "_" (Strings.splitOn "." (Core.unName (Core.bindingName binding))) bindingPathPrefix = Lists.concat2 path [ Paths.SubtermStepLetBinding (Core.bindingName binding)] result = processImmediateSubterm cx 1 namePrefix bindingPathPrefix (Core.bindingTerm binding)@@ -418,8 +419,8 @@ bodyPathPrefix = Lists.concat2 path [ Paths.SubtermStepLetBody] firstBindingName =- Optionals.cases (Lists.maybeHead bindings) "body" (\b -> Strings.intercalate "_" (Strings.splitOn "." (Core.unName (Core.bindingName b))))- bodyPrefix = Strings.cat2 firstBindingName "_body"+ Optionals.cases (Lists.head bindings) "body" (\b -> Strings.join "_" (Strings.splitOn "." (Core.unName (Core.bindingName b))))+ bodyPrefix = Strings.concat2 firstBindingName "_body" bodyResult = processImmediateSubterm cx 1 bodyPrefix bodyPathPrefix body newBody = Pairs.second bodyResult in (
src/main/haskell/Hydra/Inference.hs view
@@ -29,6 +29,7 @@ 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+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@@ -68,7 +69,7 @@ -- | Return the element at the given index, or Left(Other) with the given description if out of range atOrFail :: Int -> String -> [t0] -> Either Errors.Error t0 atOrFail i desc xs =- Optionals.cases (Lists.maybeAt i xs) (Left (Errors.ErrorOther (Errors.OtherError (Strings.cat2 "atOrFail: " desc)))) (\x -> Right x)+ Optionals.cases (Lists.at i xs) (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat2 "atOrFail: " desc)))) (\x -> Right x) -- | Unify type constraints and check the substitution bindConstraints :: Typing.InferenceContext -> Graph.Graph -> [Typing.TypeConstraint] -> Either Errors.Error Typing.TypeSubst@@ -172,12 +173,12 @@ let isTypeVarName = \name -> let parts = Strings.splitOn "." (Core.unName name)- in (Equality.lte (Lists.length parts) 1)+ in (Ordering.lte (Lists.length parts) 1) vars =- Lists.nub (Lists.filter (\v -> Logic.and (isUnbound cx v) (isTypeVarName v)) (Variables.freeVariablesInTypeOrdered typ))+ Lists.distinct (Lists.filter (\v -> Logic.and (isUnbound cx v) (isTypeVarName v)) (Variables.freeVariablesInTypeOrdered typ)) allConstraints = Graph.graphClassConstraints cx relevantConstraints =- Maps.fromList (Optionals.cat (Lists.map (\v -> Optionals.map (\meta -> (v, meta)) (Maps.lookup v allConstraints)) vars))+ 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,@@ -187,7 +188,7 @@ -- | 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 headOrFail desc xs =- Optionals.cases (Lists.maybeHead xs) (Left (Errors.ErrorOther (Errors.OtherError (Strings.cat2 "headOrFail: " desc)))) (\x -> Right x)+ Optionals.cases (Lists.head xs) (Left (Errors.ErrorOther (Errors.OtherError (Strings.concat2 "headOrFail: " desc)))) (\x -> Right x) -- | Infer types for all elements in a graph, using the provided ordered bindings. Returns both the inferred graph and the ordered inferred bindings. Paper: inference.tex, the SCC treatment of cycles (section introduction); the whole graph is one mutually recursive let. inferGraphTypes :: Typing.InferenceContext -> [Core.Binding] -> Graph.Graph -> Either Errors.Error ((Graph.Graph, [Core.Binding]), Typing.InferenceContext)@@ -284,7 +285,7 @@ Errors.otherInferenceErrorPath = (Paths.SubtermPath (Lists.reverse (Typing.inferenceContextTrace fcx2))), Errors.otherInferenceErrorMessage = "Expected a type scheme"})))) (\ts -> Right ((term1, ts), fcx2))))) (Left (Errors.ErrorInference (Errors.InferenceErrorOther (Errors.OtherInferenceError { Errors.otherInferenceErrorPath = (Paths.SubtermPath (Lists.reverse (Typing.inferenceContextTrace fcx2))),- Errors.otherInferenceErrorMessage = (Strings.cat [+ Errors.otherInferenceErrorMessage = (Strings.concat [ "Expected a single binding with a type scheme, but got: ", (Literals.showInt32 (Lists.length bindings)), " bindings"])}))))))))))@@ -374,16 +375,15 @@ stype = Core.typeSchemeBody schemaType in (Eithers.bind (ExtractCore.unionType tname stype) (\sfields -> let fcxDflt = Names.pushSubtermStep Paths.SubtermStepUnionCasesDefault fcx2- in (Eithers.bind (Eithers.mapOptional (\t -> inferTypeOfTerm fcxDflt cx t (Strings.cat [+ in (Eithers.bind (Eithers.mapOptional (\t -> inferTypeOfTerm fcxDflt cx t (Strings.concat [ "case ", (Core.unName tname), ".<default>"])) dflt) (\dfltRp -> let dfltResult = dfltRp- fcx3 =- Optionals.fromOptional fcx2 (Optionals.map (\_r -> Names.restoreTrace fcx2 (Typing.inferenceResultContext _r)) dfltRp)+ fcx3 = Optionals.withDefault fcx2 (Optionals.map (\_r -> Names.restoreTrace fcx2 (Typing.inferenceResultContext _r)) dfltRp) in (Eithers.bind (inferMany fcx3 cx (Lists.map (\f -> ( Core.caseAlternativeHandler f,- (Strings.cat [+ (Strings.concat [ "case ", (Core.unName tname), ".",@@ -405,13 +405,13 @@ Typing.typeConstraintRight = (Substitution.substInType isubst (Typing.inferenceResultType r)), Typing.typeConstraintComment = "match default"}) dfltResult) caseConstraints =- Optionals.cat (Lists.zipWith (\fname -> \itype -> Optionals.map (\ftype -> Typing.TypeConstraint {+ Optionals.givens (Lists.zipWith (\fname -> \itype -> Optionals.map (\ftype -> Typing.TypeConstraint { Typing.typeConstraintLeft = itype, Typing.typeConstraintRight = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = ftype, Core.functionTypeCodomain = cod})), Typing.typeConstraintComment = "case type"}) (Maps.lookup fname caseMap)) fnames itypes)- dfltClassConstraints = Optionals.fromOptional Maps.empty (Optionals.map Typing.inferenceResultClassConstraints dfltResult)+ dfltClassConstraints = Optionals.withDefault Maps.empty (Optionals.map Typing.inferenceResultClassConstraints dfltResult) allElemConstraints = mergeClassConstraints caseElemConstraints dfltClassConstraints in (Eithers.bind (mapConstraints fcx5 cx (\subst -> yieldWithConstraints fcx5 (buildTypeApplicationTerm svars (Core.TermCases (Core.CaseStatement { Core.caseStatementTypeName = tname,@@ -439,7 +439,7 @@ 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 [- var] (trmCons [])) (typCons (Core.TypeVariable var)) Substitution.idTypeSubst classConstraints)) (Eithers.bind (inferMany fcx2 cx (Lists.zip els (Lists.map (\i -> Strings.cat [+ 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 -> let results = Pairs.first resultsRp@@ -603,7 +603,7 @@ bindingMap = Maps.fromList (Lists.zip names bindings0) createLet = \e -> \group -> Core.TermLet (Core.Let {- Core.letBindings = (Optionals.cat (Lists.map (\n -> Maps.lookup n bindingMap) group)),+ Core.letBindings = (Optionals.givens (Lists.map (\n -> Maps.lookup n bindingMap) group)), Core.letBody = e}) rewrittenLet = Lists.foldl createLet body0 (Lists.reverse groups) restoreLet =@@ -624,7 +624,7 @@ e = Pairs.second result bindingMap2 = Maps.fromList (Lists.map (\b -> (Core.bindingName b, b)) bindingList) in (Core.TermLet (Core.Let {- Core.letBindings = (Optionals.cat (Lists.map (\n -> Maps.lookup n bindingMap2) names)),+ Core.letBindings = (Optionals.givens (Lists.map (\n -> Maps.lookup n bindingMap2) names)), Core.letBody = e})) rewriteResult = \iresult ->@@ -806,7 +806,7 @@ inferTypeOfOptional :: Typing.InferenceContext -> Graph.Graph -> Maybe Core.Term -> Either Errors.Error Typing.InferenceResult inferTypeOfOptional fcx cx m = - let trmCons = \terms -> Core.TermOptional (Lists.maybeHead terms)+ let trmCons = \terms -> Core.TermOptional (Lists.head terms) in (inferTypeOfCollection fcx cx (\x -> Core.TypeOptional x) trmCons "optional element" Sets.empty (Optionals.cases m [] Lists.singleton)) -- | Infer the type of a pair (Either version). Paper: inference.tex, rule Pair.@@ -860,7 +860,7 @@ in (Eithers.bind (Resolution.requireSchemaType fcx (Graph.graphSchemaTypes cx) tname) (\stRp -> let schemaType = Pairs.first stRp fcx2 = Pairs.second stRp- in (Eithers.bind (inferMany fcx2 cx (Lists.map (\f -> (Core.fieldTerm f, (Strings.cat2 "field " (Core.unName (Core.fieldName f))))) fields)) (\rp ->+ in (Eithers.bind (inferMany fcx2 cx (Lists.map (\f -> (Core.fieldTerm f, (Strings.concat2 "field " (Core.unName (Core.fieldName f))))) fields)) (\rp -> let results = Pairs.first rp fcx3 = Pairs.second rp svars = Core.typeSchemeVariables schemaType@@ -974,12 +974,12 @@ let tsResult = Resolution.instantiateTypeScheme fcx scheme ts = Pairs.first tsResult fcx2 = Pairs.second tsResult- constraints = Optionals.fromOptional Maps.empty (Core.typeSchemeConstraints ts)+ constraints = Optionals.withDefault Maps.empty (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.fromOptional Maps.empty (Core.typeSchemeConstraints ts)+ constraints = Optionals.withDefault Maps.empty (Core.typeSchemeConstraints ts) in (Right (Typing.InferenceResult { Typing.inferenceResultTerm = (buildTypeApplicationTerm (Core.typeSchemeVariables ts) (Core.TermVariable name)), Typing.inferenceResultType = (Core.typeSchemeBody ts),@@ -1026,7 +1026,7 @@ k = Core.bindingName binding v = Core.bindingTerm binding fcxBind = Names.pushSubtermStep (Paths.SubtermStepLetBinding k) fcx- in (Eithers.bind (inferTypeOfTerm fcxBind cx v (Strings.cat [+ in (Eithers.bind (inferTypeOfTerm fcxBind cx v (Strings.concat [ "temporary let binding '", (Core.unName k), "'"])) (\result1 ->@@ -1038,7 +1038,7 @@ in (Eithers.bind (Optionals.cases (Core.bindingTypeScheme binding) (Right Maps.empty) (\ts -> let tsResult = Resolution.instantiateTypeScheme fcx2 ts instantiatedTs = Pairs.first tsResult- freshConstraints = Optionals.fromOptional Maps.empty (Core.typeSchemeConstraints instantiatedTs)+ freshConstraints = Optionals.withDefault Maps.empty (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 ->@@ -1080,7 +1080,7 @@ in (Optionals.cases (Maps.lookup k acc) (Maps.insert k v acc) (\existing -> let merged = Core.TypeVariableConstraints {- Core.typeVariableConstraintsClasses = (Lists.nub (Lists.concat2 (Core.typeVariableConstraintsClasses existing) (Core.typeVariableConstraintsClasses v)))}+ Core.typeVariableConstraintsClasses = (Lists.distinct (Lists.concat2 (Core.typeVariableConstraintsClasses existing) (Core.typeVariableConstraintsClasses v)))} in (Maps.insert k merged acc)))) m1 (Maps.toList m2) -- | Show an inference result for debugging@@ -1090,7 +1090,7 @@ let term = Typing.inferenceResultTerm result typ = Typing.inferenceResultType result subst = Typing.inferenceResultSubst result- in (Strings.cat [+ in (Strings.concat [ "{term=", (PrintCore.term term), ", type=",
src/main/haskell/Hydra/Json/Decode.hs view
@@ -57,13 +57,13 @@ case ft of Core.FloatTypeFloat32 -> case value of Model.ValueNumber v1 -> Right (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat32 (LibLiterals.decimalToFloat32 v1))))- Model.ValueString v1 -> Optionals.cases (parseSpecialFloat32 v1) (Left (Strings.cat [+ Model.ValueString v1 -> Optionals.cases (parseSpecialFloat32 v1) (Left (Strings.concat [ "invalid float32 sentinel: ", v1])) (\v -> Right (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat32 v)))) _ -> Left "expected number or special float string for float32" Core.FloatTypeFloat64 -> case value of Model.ValueNumber v1 -> Right (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 (LibLiterals.decimalToFloat64 v1))))- Model.ValueString v1 -> Optionals.cases (parseSpecialFloat v1) (Left (Strings.cat [+ Model.ValueString v1 -> Optionals.cases (parseSpecialFloat v1) (Left (Strings.concat [ "invalid float64 sentinel: ", v1])) (\v -> Right (Core.TermLiteral (Core.LiteralFloat (Core.FloatValueFloat64 v)))) _ -> Left "expected number or special float string for float64"@@ -76,21 +76,21 @@ let strResult = expectString value in (Eithers.either (\err -> Left err) (\s -> let parsed = LibLiterals.readBigint s- in (Optionals.cases parsed (Left (Strings.cat [+ in (Optionals.cases 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- in (Optionals.cases parsed (Left (Strings.cat [+ in (Optionals.cases 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- in (Optionals.cases parsed (Left (Strings.cat [+ in (Optionals.cases parsed (Left (Strings.concat [ "invalid uint64: ", s])) (\v -> Right (Core.TermLiteral (Core.LiteralInteger (Core.IntegerValueUint64 v)))))) strResult) Core.IntegerTypeInt8 ->@@ -112,7 +112,7 @@ Model.ValueNumber v1 -> Right (Core.TermLiteral (Core.LiteralInteger (Core.IntegerValueUint32 (LibLiterals.bigintToUint32 (LibLiterals.decimalToBigint v1))))) Model.ValueString v1 -> let parsed = LibLiterals.readUint32 v1- in (Optionals.cases parsed (Left (Strings.cat [+ in (Optionals.cases parsed (Left (Strings.concat [ "invalid uint32: ", v1])) (\v -> Right (Core.TermLiteral (Core.LiteralInteger (Core.IntegerValueUint32 v))))) _ -> Left "expected number or string for uint32"@@ -123,7 +123,7 @@ case lt of Core.LiteralTypeBinary -> let strResult = expectString value- in (Eithers.map (\s -> Core.TermLiteral (Core.LiteralBinary (LibLiterals.stringToBinary s))) strResult)+ in (Eithers.map (\s -> Core.TermLiteral (Core.LiteralBinary (LibLiterals.base64ToBinary s))) strResult) Core.LiteralTypeBoolean -> case value of Model.ValueBoolean v1 -> Right (Core.TermLiteral (Core.LiteralBoolean v1)) _ -> Left "expected boolean"@@ -180,12 +180,12 @@ Core.TypeForall v0 -> Right (Substitution.substInType (Substitution.singletonTypeSubst (Core.forallTypeParameter v0) arg) (Core.forallTypeBody v0)) Core.TypeVariable v0 -> let lookedUp = Maps.lookup v0 types- in (Optionals.cases lookedUp (Left (Strings.cat [+ in (Optionals.cases lookedUp (Left (Strings.concat [ "unknown type variable: ", (Core.unName v0)])) (\resolvedFn -> reduceApp (Core.ApplicationType { Core.applicationTypeFunction = resolvedFn, Core.applicationTypeArgument = arg})))- _ -> Left (Strings.cat [+ _ -> Left (Strings.concat [ "cannot apply a non-parametric type: ", (PrintCore.type_ fn)]) in case stripped of@@ -212,7 +212,7 @@ _ -> False in (Logic.ifElse isNestedMaybe ( let decodeJust =- \arr -> Optionals.cases (Lists.maybeHead arr) (Left "expected single-element array for Just") (\firstVal -> Eithers.map (\v -> Core.TermOptional (Just v)) (fromJson types tname v0 firstVal))+ \arr -> Optionals.cases (Lists.head arr) (Left "expected single-element array for Just") (\firstVal -> Eithers.map (\v -> Core.TermOptional (Just v)) (fromJson types tname v0 firstVal)) decodeMaybeArray = \arr -> let len = Lists.length arr@@ -232,7 +232,7 @@ ftype = Core.fieldTypeType ft mval = Maps.lookup (Core.unName fname) obj defaultVal = Model.ValueNull- jsonVal = Optionals.fromOptional defaultVal mval+ jsonVal = Optionals.withDefault defaultVal mval decoded = fromJson types tname ftype jsonVal in (Eithers.map (\v -> Core.Field { Core.fieldName = fname,@@ -244,7 +244,7 @@ Core.TypeUnion v0 -> let decodeVariant = \key -> \val -> \ftype ->- let jsonVal = Optionals.fromOptional Model.ValueNull val+ let jsonVal = Optionals.withDefault Model.ValueNull val decoded = fromJson types tname ftype jsonVal in (Eithers.map (\v -> Core.TermInject (Core.Injection { Core.injectionTypeName = tname,@@ -252,15 +252,15 @@ Core.fieldName = (Core.Name key), Core.fieldTerm = v}})) decoded) findAndDecode =- \key -> \val -> \fts -> Optionals.cases (Lists.find (\ft -> Equality.equal (Core.unName (Core.fieldTypeName ft)) key) fts) (Left (Strings.cat [+ \key -> \val -> \fts -> Optionals.cases (Lists.find (\ft -> Equality.equal (Core.unName (Core.fieldTypeName ft)) key) fts) (Left (Strings.concat [ "unknown variant: ", key])) (\ft -> decodeVariant key val (Core.fieldTypeType ft)) decodeSingleKey =- \obj -> Optionals.cases (Lists.maybeHead (Maps.keys obj)) (Left "expected single-key object for union") (\k -> findAndDecode k (Maps.lookup k obj) v0)+ \obj -> Optionals.cases (Lists.head (Maps.keys obj)) (Left "expected single-key object for union") (\k -> findAndDecode k (Maps.lookup k obj) v0) processUnion = \obj -> Logic.ifElse (Equality.equal (Lists.length (Maps.keys obj)) 1) (decodeSingleKey obj) (Left "expected single-key object for union") decodeCompactString =- \s -> Optionals.cases (Lists.find (\ft -> Equality.equal (Core.unName (Core.fieldTypeName ft)) s) v0) (Left (Strings.cat [+ \s -> Optionals.cases (Lists.find (\ft -> Equality.equal (Core.unName (Core.fieldTypeName ft)) s) v0) (Left (Strings.concat [ "unknown variant: ", s])) (\ft -> let ftypeStripped = Strip.deannotateType (Core.fieldTypeType ft)@@ -270,7 +270,7 @@ Core.injectionField = Core.Field { Core.fieldName = (Core.Name s), Core.fieldTerm = Core.TermUnit}}))- _ -> Left (Strings.cat [+ _ -> Left (Strings.concat [ "compact string form requires unit-typed variant, got non-unit type for variant: ", s])) in case value of@@ -329,10 +329,10 @@ in (Eithers.map (\v -> Core.TermEither (Left v)) decoded)))) objResult) Core.TypeVariable v0 -> let lookedUp = Maps.lookup v0 types- in (Optionals.cases lookedUp (Left (Strings.cat [+ in (Optionals.cases lookedUp (Left (Strings.concat [ "unknown type variable: ", (Core.unName v0)])) (\resolvedType -> fromJson types v0 resolvedType value))- _ -> Left (Strings.cat [+ _ -> Left (Strings.concat [ "unsupported type for JSON decoding: ", (PrintCore.type_ typ)])
src/main/haskell/Hydra/Json/Decoding.hs view
@@ -58,7 +58,7 @@ -- | Decode a required field from a JSON object decodeField :: (t0 -> Either String t1) -> String -> M.Map String t0 -> Either String t1 decodeField decodeValue name m =- Eithers.bind (decodeOptionalField decodeValue name m) (\mf -> Optionals.cases mf (Left (Strings.cat2 "missing field: " name)) (\f -> Right f))+ Eithers.bind (decodeOptionalField decodeValue name m) (\mf -> Optionals.cases mf (Left (Strings.concat2 "missing field: " name)) (\f -> Right f)) -- | Decode a JSON object value to a name-keyed map. Field order is not preserved; decoding looks fields up by name. decodeObject :: Model.Value -> Either String (M.Map String Model.Value)
src/main/haskell/Hydra/Json/Encode.hs view
@@ -81,7 +81,7 @@ encodeLiteral :: Core.Literal -> Either t0 Model.Value encodeLiteral lit = case lit of- Core.LiteralBinary v0 -> Right (Model.ValueString (LibLiterals.binaryToString v0))+ Core.LiteralBinary v0 -> Right (Model.ValueString (LibLiterals.binaryToBase64 v0)) Core.LiteralBoolean v0 -> Right (Model.ValueBoolean v0) Core.LiteralDecimal v0 -> Right (Model.ValueNumber v0) Core.LiteralFloat v0 -> encodeFloat v0@@ -110,12 +110,12 @@ Core.TypeForall v0 -> Right (Substitution.substInType (Substitution.singletonTypeSubst (Core.forallTypeParameter v0) arg) (Core.forallTypeBody v0)) Core.TypeVariable v0 -> let lookedUp = Maps.lookup v0 types- in (Optionals.cases lookedUp (Left (Strings.cat [+ in (Optionals.cases lookedUp (Left (Strings.concat [ "unknown type variable: ", (Core.unName v0)])) (\resolvedFn -> reduceApp (Core.ApplicationType { Core.applicationTypeFunction = resolvedFn, Core.applicationTypeArgument = arg})))- _ -> Left (Strings.cat [+ _ -> Left (Strings.concat [ "cannot apply a non-parametric type: ", (PrintCore.type_ fn)]) in case stripped of@@ -175,7 +175,7 @@ fields = Core.recordFields v1 encodedPairs = Eithers.mapList (\ftf -> encodeFieldWithType (Pairs.first ftf) (Pairs.second ftf)) (Lists.zip fieldTypes fields)- in (Eithers.map (\pairs -> Model.ValueObject (Optionals.cat pairs)) encodedPairs)+ in (Eithers.map (\pairs -> Model.ValueObject (Optionals.givens pairs)) encodedPairs) _ -> Left "expected record term" Core.TypeUnion v0 -> case strippedTerm of Core.TermInject v1 ->@@ -183,7 +183,7 @@ fname = Core.unName (Core.fieldName field) fterm = Core.fieldTerm field ftypeResult =- Optionals.cases (Lists.find (\ft -> Equality.equal (Core.unName (Core.fieldTypeName ft)) fname) v0) (Left (Strings.cat [+ Optionals.cases (Lists.find (\ft -> Equality.equal (Core.unName (Core.fieldTypeName ft)) fname) v0) (Left (Strings.concat [ "unknown variant: ", fname])) (\ft -> Right (Core.fieldTypeType ft)) in (Eithers.either (\err -> Left err) (\ftype ->@@ -246,7 +246,7 @@ Core.TypeVariable v0 -> let lookedUp = Maps.lookup v0 types in (Optionals.cases lookedUp (toJsonUntyped term) (\resolvedType -> toJson types v0 resolvedType term))- _ -> Left (Strings.cat [+ _ -> Left (Strings.concat [ "unsupported type for JSON encoding: ", (PrintCore.type_ typ)]) @@ -320,6 +320,6 @@ let encodedR = toJsonUntyped r in (Eithers.map (\v -> Model.ValueObject [ ("right", v)]) encodedR)) v0- _ -> Left (Strings.cat [+ _ -> Left (Strings.concat [ "unsupported term variant for JSON encoding: ", (PrintCore.term term)])
src/main/haskell/Hydra/Json/Parser.hs view
@@ -18,10 +18,12 @@ 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.Functions as Functions 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.Optionals as Optionals+import qualified Hydra.Overlay.Haskell.Lib.Ordering as Ordering import qualified Hydra.Overlay.Haskell.Lib.Strings as Strings import qualified Hydra.Packaging as Packaging import qualified Hydra.Parsers as Parsers@@ -46,7 +48,7 @@ -- | Parse a single digit (0-9) digit :: Parsing.Parser Int-digit = Parsers.satisfy (\c -> Logic.and (Equality.gte c 48) (Equality.lte c 57))+digit = Parsers.satisfy (\c -> Logic.and (Ordering.gte c 48) (Ordering.lte c 57)) -- | Parse one or more digits as a string digits :: Parsing.Parser String@@ -78,16 +80,16 @@ -- | 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.cat2 (Strings.cat2 "e" (Optionals.cases 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.cases sign "" (\arg_ -> Strings.fromList (Lists.pure arg_)))) digits) digits))) -- | Parse the optional fractional part of a JSON number jsonFractionPart :: Parsing.Parser (Maybe String)-jsonFractionPart = Parsers.optional (Parsers.bind (Parsers.char 46) (\_ -> Parsers.map (\d -> Strings.cat2 "." d) digits))+jsonFractionPart = Parsers.optional (Parsers.bind (Parsers.char 46) (\_ -> Parsers.map (\d -> Strings.concat2 "." d) digits)) -- | Parse the integer part of a JSON number (optional minus, then digits) jsonIntegerPart :: Parsing.Parser String jsonIntegerPart =- Parsers.bind (Parsers.optional (Parsers.char 45)) (\sign -> Parsers.bind digits (\digits -> Parsers.pure (Optionals.cases sign digits (\_ -> Strings.cat2 "-" digits))))+ Parsers.bind (Parsers.optional (Parsers.char 45)) (\sign -> Parsers.bind digits (\digits -> Parsers.pure (Optionals.cases sign digits (\_ -> Strings.concat2 "-" digits)))) -- | Parse a JSON object key-value pair jsonKeyValue :: Parsing.Parser (String, Model.Value)@@ -103,8 +105,8 @@ jsonNumber = token (Parsers.bind jsonIntegerPart (\intPart -> Parsers.bind jsonFractionPart (\fracPart -> Parsers.bind jsonExponentPart (\expPart -> let numStr =- Strings.cat2 (Strings.cat2 intPart (Optionals.cases fracPart "" Equality.identity)) (Optionals.cases expPart "" Equality.identity)- in (Parsers.pure (Model.ValueNumber (Optionals.cases (Literals.readDecimal numStr) (Literals.stringToDecimal "0.0") Equality.identity)))))))+ Strings.concat2 (Strings.concat2 intPart (Optionals.cases fracPart "" Functions.identity)) (Optionals.cases expPart "" Functions.identity)+ in (Parsers.pure (Model.ValueNumber (Optionals.cases (Literals.readDecimal numStr) (Literals.stringToDecimal "0.0") Functions.identity))))))) -- | Parse a JSON object jsonObject :: Parsing.Parser Model.Value
src/main/haskell/Hydra/Json/Writer.hs view
@@ -23,6 +23,7 @@ import qualified Hydra.Overlay.Haskell.Lib.Logic as Logic import qualified Hydra.Overlay.Haskell.Lib.Math as Math 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.Strings as Strings import qualified Hydra.Packaging as Packaging@@ -61,20 +62,20 @@ hexByte c = let nibble =- \i -> Optionals.fromOptional "?" (Optionals.map (\ch -> Strings.fromList (Lists.pure ch)) (Strings.maybeCharAt i "0123456789abcdef"))- hi = nibble (Optionals.fromOptional 0 (Math.maybeDiv c 16))- lo = nibble (Optionals.fromOptional 0 (Math.maybeMod c 16))- in (Strings.cat2 hi lo)+ \i -> Optionals.withDefault "?" (Optionals.map (\ch -> Strings.fromList (Lists.pure 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) -- | Escape and quote a string for JSON output jsonString :: String -> String jsonString s = - let hexEscape = \c -> Strings.cat2 "\\u00" (hexByte c)+ 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 (Equality.lt c 32) (hexEscape c) (Strings.fromList (Lists.pure c)))))))))- escaped = Strings.cat (Lists.map escape (Strings.toList s))- in (Strings.cat2 (Strings.cat2 "\"" escaped) "\"")+ \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)))))))))+ escaped = Strings.concat (Lists.map escape (Strings.toList s))+ in (Strings.concat2 (Strings.concat2 "\"" escaped) "\"") -- | Convert a key-value pair to an AST expression keyValueToExpr :: (String, Model.Value) -> Ast.Expr@@ -100,6 +101,6 @@ shown = Literals.showDecimal v0 isWhole = Equality.equal v0 (Literals.bigintToDecimal rounded) plain = Literals.showBigint rounded- in (Serialization.cst (Logic.ifElse (Logic.and isWhole (Equality.lte (Strings.length plain) (Strings.length shown))) plain shown))+ 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/Lexical.hs view
@@ -25,6 +25,7 @@ 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+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@@ -63,7 +64,7 @@ mergedTerms = Maps.union elementTerms letTerms filteredTerms = Maps.filterWithKey (\k -> \_v -> Logic.not (Maps.member k primitives)) mergedTerms elementTypes =- Maps.fromList (Optionals.cat (Lists.map (\b -> Optionals.map (\ts -> (Core.bindingName b, ts)) (Core.bindingTypeScheme b)) elements))+ Maps.fromList (Optionals.givens (Lists.map (\b -> Optionals.map (\ts -> (Core.bindingName b, ts)) (Core.bindingTypeScheme b)) elements)) filteredTypes = Maps.filterWithKey (\k -> \_v -> Logic.not (Maps.member k primitives)) elementTypes in Graph.Graph { Graph.graphBoundTerms = filteredTerms,@@ -81,7 +82,7 @@ let tryName = \index ->- let candidate = Logic.ifElse (Equality.equal index 1) name (Core.Name (Strings.cat2 (Core.unName name) (Literals.showInt32 index)))+ let candidate = Logic.ifElse (Equality.equal index 1) name (Core.Name (Strings.concat2 (Core.unName name) (Literals.showInt32 index))) in (Logic.ifElse (Sets.member candidate reserved) (tryName (Math.add index 1)) candidate) in (tryName 1) @@ -232,10 +233,10 @@ in (Optionals.cases (Maps.lookup fname mapping) (Left (Errors.ErrorResolution (Errors.ResolutionErrorNoMatchingField (Errors.NoMatchingFieldError { Errors.noMatchingFieldErrorFieldName = fname})))) (\f -> f val)) in (Logic.ifElse (Equality.equal (Core.unName (Core.injectionTypeName v0)) (Core.unName tname)) exp (Left (Errors.ErrorResolution (Errors.ResolutionErrorUnexpectedShape (Errors.UnexpectedShapeError {- Errors.unexpectedShapeErrorExpected = (Strings.cat2 "injection for type " (Core.unName tname)),+ Errors.unexpectedShapeErrorExpected = (Strings.concat2 "injection for type " (Core.unName tname)), Errors.unexpectedShapeErrorActual = (PrintCore.term term)}))))) _ -> Left (Errors.ErrorResolution (Errors.ResolutionErrorUnexpectedShape (Errors.UnexpectedShapeError {- Errors.unexpectedShapeErrorExpected = (Strings.cat2 "injection for type " (Core.unName tname)),+ Errors.unexpectedShapeErrorExpected = (Strings.concat2 "injection for type " (Core.unName tname)), Errors.unexpectedShapeErrorActual = (PrintCore.term stripped)}))) -- | Build a (fieldName, decoder) pair for a unit-valued union variant: the decoder ignores its argument and returns a fixed value@@ -248,10 +249,10 @@ let showAll = False ellipsis =- \strings -> Logic.ifElse (Logic.and (Equality.gt (Lists.length strings) 3) (Logic.not showAll)) (Lists.concat2 (Lists.take 3 strings) [+ \strings -> Logic.ifElse (Logic.and (Ordering.gt (Lists.length strings) 3) (Logic.not showAll)) (Lists.concat2 (Lists.take 3 strings) [ "..."]) strings errMsg =- Strings.cat2 (Strings.cat2 (Strings.cat2 (Strings.cat2 "no such element: " (Core.unName name)) ". Available elements: {") (Strings.intercalate ", " (ellipsis (Lists.map Core.unName (Maps.keys (Graph.graphBoundTerms graph)))))) "}"+ Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 "no such element: " (Core.unName name)) ". Available elements: {") (Strings.join ", " (ellipsis (Lists.map Core.unName (Maps.keys (Graph.graphBoundTerms graph)))))) "}" in (Optionals.cases (lookupBinding graph name) (Left (Errors.ErrorResolution (Errors.ResolutionErrorOther (Errors.OtherResolutionError errMsg)))) (\x -> Right x)) -- | Look up a primitive in a graph by name, failing if it is not registered
src/main/haskell/Hydra/Lib/Chars.hs view
@@ -53,8 +53,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "char"),+ Typing.parameterDescription = (Just "the character to test, as a Unicode code point"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -81,8 +81,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "char"),+ Typing.parameterDescription = (Just "the character to test, as a Unicode code point"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -108,8 +108,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "char"),+ Typing.parameterDescription = (Just "the character to test, as a Unicode code point"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -136,8 +136,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "char"),+ Typing.parameterDescription = (Just "the character to test, as a Unicode code point"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -163,8 +163,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "char"),+ Typing.parameterDescription = (Just "the character to test, as a Unicode code point"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -191,8 +191,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "char"),+ Typing.parameterDescription = (Just "the character to test, as a Unicode code point"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -219,8 +219,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "char"),+ Typing.parameterDescription = (Just "the character to convert, as a Unicode code point"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -247,8 +247,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "char"),+ Typing.parameterDescription = (Just "the character to convert, as a Unicode code point"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {
src/main/haskell/Hydra/Lib/Defaults.hs view
@@ -133,83 +133,6 @@ Core.applicationArgument = (Core.TermEither (Right (Core.TermVariable (Core.Name "acc0"))))})), Core.applicationArgument = (Core.TermVariable (Core.Name "xs"))}))}))}))}))), (- Core.Name "hydra.lib.eithers.foldl",- (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "f"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "acc0"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "xs"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.foldl")),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "acc"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "el"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.bind")),- Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "a"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "f")),- Core.applicationArgument = (Core.TermVariable (Core.Name "a"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "el"))}))}))}))}))}))})),- Core.applicationArgument = (Core.TermEither (Right (Core.TermVariable (Core.Name "acc0"))))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "xs"))}))}))}))}))),- (- Core.Name "hydra.lib.eithers.fromLeft",- (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "def"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "e"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermVariable (Core.Name "x"))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermVariable (Core.Name "def"))}))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "e"))}))}))}))),- (- Core.Name "hydra.lib.eithers.fromRight",- (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "def"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "e"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermVariable (Core.Name "def"))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermVariable (Core.Name "x"))}))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "e"))}))}))}))),- ( Core.Name "hydra.lib.eithers.isLeft", (Core.TermLambda (Core.Lambda { Core.lambdaParameter = (Core.Name "e"),@@ -473,56 +396,6 @@ Core.applicationArgument = (Core.TermPair (Core.TermList [], (Core.TermList [])))})), Core.applicationArgument = (Core.TermVariable (Core.Name "xs"))}))}))), (- Core.Name "hydra.lib.eithers.partitionEithers",- (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "xs"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.foldr")),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "e"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "acc"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "l"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermPair (- Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.cons")),- Core.applicationArgument = (Core.TermVariable (Core.Name "l"))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.pairs.first")),- Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))}))}),- (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.pairs.second")),- Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))}))))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "r"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermPair (- Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.pairs.first")),- Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))}),- (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.cons")),- Core.applicationArgument = (Core.TermVariable (Core.Name "r"))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.pairs.second")),- Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))}))}))))}))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "e"))}))}))}))})),- 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"),@@ -563,50 +436,6 @@ Core.applicationArgument = (Core.TermList [])})), Core.applicationArgument = (Core.TermVariable (Core.Name "xs"))}))}))), (- Core.Name "hydra.lib.equality.identity",- (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermVariable (Core.Name "x"))}))),- (- Core.Name "hydra.lib.equality.max",- (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "y"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.logic.ifElse")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.equality.gte")),- Core.applicationArgument = (Core.TermVariable (Core.Name "x"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "y"))}))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "x"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "y"))}))}))}))),- (- Core.Name "hydra.lib.equality.min",- (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "y"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.logic.ifElse")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.equality.lte")),- Core.applicationArgument = (Core.TermVariable (Core.Name "x"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "y"))}))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "x"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "y"))}))}))}))),- ( Core.Name "hydra.lib.equality.notEqual", (Core.TermLambda (Core.Lambda { Core.lambdaParameter = (Core.Name "x"),@@ -1025,7 +854,7 @@ Core.lambdaDomain = Nothing, Core.lambdaBody = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.fromOptional")),+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.withDefault")), Core.applicationArgument = (Core.TermVariable (Core.Name "def"))})), Core.applicationArgument = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -1098,11 +927,11 @@ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.equality.equal")), Core.applicationArgument = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.fromOptional")),+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.withDefault")), Core.applicationArgument = (Core.TermLiteral (Core.LiteralInteger (Core.IntegerValueInt32 0)))})), Core.applicationArgument = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.maybeMod")),+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mod")), Core.applicationArgument = (Core.TermVariable (Core.Name "x"))})), Core.applicationArgument = (Core.TermLiteral (Core.LiteralInteger (Core.IntegerValueInt32 2)))}))}))})), Core.applicationArgument = (Core.TermLiteral (Core.LiteralInteger (Core.IntegerValueInt32 0)))}))}))),@@ -1157,37 +986,6 @@ Core.applicationArgument = (Core.TermOptional Nothing)})), Core.applicationArgument = (Core.TermVariable (Core.Name "f"))}))}))}))), (- Core.Name "hydra.lib.optionals.cat",- (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "xs"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.foldr")),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "m"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "acc"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.cases")),- Core.applicationArgument = (Core.TermVariable (Core.Name "m"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "v"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.cons")),- Core.applicationArgument = (Core.TermVariable (Core.Name "v"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))}))}))}))}))}))})),- Core.applicationArgument = (Core.TermList [])})),- Core.applicationArgument = (Core.TermVariable (Core.Name "xs"))}))}))),- ( Core.Name "hydra.lib.optionals.compose", (Core.TermLambda (Core.Lambda { Core.lambdaParameter = (Core.Name "f"),@@ -1243,24 +1041,6 @@ Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))}))})), Core.applicationArgument = (Core.TermVariable (Core.Name "xs"))}))}))}))}))), (- Core.Name "hydra.lib.optionals.fromOptional",- (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "def"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "m"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.cases")),- Core.applicationArgument = (Core.TermVariable (Core.Name "m"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "def"))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermVariable (Core.Name "x"))}))}))}))}))),- ( Core.Name "hydra.lib.optionals.givens", (Core.TermLambda (Core.Lambda { Core.lambdaParameter = (Core.Name "xs"),@@ -1393,7 +1173,7 @@ Core.lambdaParameter = (Core.Name "xs"), Core.lambdaDomain = Nothing, Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.cat")),+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.givens")), Core.applicationArgument = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.map")),
src/main/haskell/Hydra/Lib/Effects.hs view
@@ -56,15 +56,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "ef"),+ Typing.parameterDescription = (Just "the effect producing the function to apply"), Typing.parameterType = (Core.TypeEffect (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "y"))}))), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "ex"),+ Typing.parameterDescription = (Just "the effect producing the argument"), Typing.parameterType = (Core.TypeEffect (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -95,13 +95,13 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "e"),+ Typing.parameterDescription = (Just "the effect to interpret first"), Typing.parameterType = (Core.TypeEffect (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the function producing the next effect from e's result"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeEffect (Core.TypeVariable (Core.Name "y")))})),@@ -136,22 +136,22 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the first effect-returning function"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeEffect (Core.TypeVariable (Core.Name "y")))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "g"),+ Typing.parameterDescription = (Just "the second effect-returning function"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "y")), Core.functionTypeCodomain = (Core.TypeEffect (Core.TypeVariable (Core.Name "z")))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the input to the composed computation"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -168,53 +168,7 @@ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata { Packaging.entityMetadataDescription = (Just "Left-fold over a list with an effect-returning function."), Packaging.entityMetadataComments = [- "foldList(f, acc0, xs) describes an effectful left fold over xs, sequencing applications of f from left to right.",- "New name for foldl (retained as a deprecated alias until the #417 breaking wave removes it)."],- 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 "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")),- Core.functionTypeCodomain = (Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = (Core.TypeVariable (Core.Name "y")),- Core.functionTypeCodomain = (Core.TypeEffect (Core.TypeVariable (Core.Name "x")))}))})),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeVariable (Core.Name "x")),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "y"))),- Typing.parameterIsLazy = False}],- Typing.termSignatureResult = Typing.Result {- Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeEffect (Core.TypeVariable (Core.Name "x")))}},- Packaging.primitiveDefinitionIsPure = False,- Packaging.primitiveDefinitionIsTotal = True,- Packaging.primitiveDefinitionDefaultImplementation = Nothing}--foldl :: Packaging.PrimitiveDefinition-foldl =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.effects.foldl"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Left-fold over a list with an effect-returning function."),- Packaging.entityMetadataComments = [- "foldl(f, acc0, xs) describes an effectful left fold over xs, sequencing applications of f from left to right."],+ "foldList(f, acc0, xs) describes an effectful left fold over xs, sequencing applications of f from left to right."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})), Packaging.primitiveDefinitionSignature = Typing.TermSignature {@@ -227,8 +181,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the effect-returning combining function"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeFunction (Core.FunctionType {@@ -236,13 +190,13 @@ Core.functionTypeCodomain = (Core.TypeEffect (Core.TypeVariable (Core.Name "x")))}))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "acc0"),+ Typing.parameterDescription = (Just "the initial accumulator value"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to fold over"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "y"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -273,15 +227,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the pure function to apply to the effect's result"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "y"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "e"),+ Typing.parameterDescription = (Just "the effect to interpret"), Typing.parameterType = (Core.TypeEffect (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -311,15 +265,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the effect-returning function to apply to each element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeEffect (Core.TypeVariable (Core.Name "y")))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to map over"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -349,15 +303,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the effect-returning function to apply to the contained value"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeEffect (Core.TypeVariable (Core.Name "y")))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the optional to map over"), Typing.parameterType = (Core.TypeOptional (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -390,15 +344,15 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the effect-returning function to apply to each element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeEffect (Core.TypeVariable (Core.Name "y")))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the set to map over"), Typing.parameterType = (Core.TypeSet (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -425,8 +379,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the pure value to lift into an effect"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {
src/main/haskell/Hydra/Lib/Eithers.hs view
@@ -62,8 +62,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "ef"),+ Typing.parameterDescription = (Just "the either containing the function to apply"), Typing.parameterType = (Core.TypeEither (Core.EitherType { Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "x")), Core.eitherTypeRight = (Core.TypeFunction (Core.FunctionType {@@ -71,8 +71,8 @@ Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "z"))}))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "ex"),+ Typing.parameterDescription = (Just "the either containing the argument"), Typing.parameterType = (Core.TypeEither (Core.EitherType { Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "x")), Core.eitherTypeRight = (Core.TypeVariable (Core.Name "y"))})),@@ -130,22 +130,22 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the function to apply to a Left value"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "z"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "g"),+ Typing.parameterDescription = (Just "the function to apply to a Right value"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "y")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "w"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "e"),+ Typing.parameterDescription = (Just "the either value to map over"), Typing.parameterType = (Core.TypeEither (Core.EitherType { Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "x")), Core.eitherTypeRight = (Core.TypeVariable (Core.Name "y"))})),@@ -209,15 +209,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "e"),+ Typing.parameterDescription = (Just "the either value to bind"), Typing.parameterType = (Core.TypeEither (Core.EitherType { Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "x")), Core.eitherTypeRight = (Core.TypeVariable (Core.Name "y"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the function to apply to a Right value"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "y")), Core.functionTypeCodomain = (Core.TypeEither (Core.EitherType {@@ -276,8 +276,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the first Kleisli arrow to apply"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeEither (Core.EitherType {@@ -285,8 +285,8 @@ Core.eitherTypeRight = (Core.TypeVariable (Core.Name "y"))}))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "g"),+ Typing.parameterDescription = (Just "the second Kleisli arrow to apply"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "y")), Core.functionTypeCodomain = (Core.TypeEither (Core.EitherType {@@ -294,8 +294,8 @@ Core.eitherTypeRight = (Core.TypeVariable (Core.Name "z"))}))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the input value"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -347,22 +347,22 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the function to apply to a Left value"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "z"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "g"),+ Typing.parameterDescription = (Just "the function to apply to a Right value"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "y")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "z"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "e"),+ Typing.parameterDescription = (Just "the either value to eliminate"), Typing.parameterType = (Core.TypeEither (Core.EitherType { Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "x")), Core.eitherTypeRight = (Core.TypeVariable (Core.Name "y"))})),@@ -382,7 +382,6 @@ Packaging.entityMetadataDescription = (Just "Left-fold over a list with an Either-returning function, short-circuiting on Left."), Packaging.entityMetadataComments = [ "foldList(f, acc0, xs) folds f over xs from the left, threading an accumulator of type a, where each application may fail with Left e: it iterates while f returns Right, propagates Left on the first failure, and returns Right (final accumulator) if all elements were processed.",- "New name for foldl (retained as a deprecated alias until the #417 breaking wave removes it).", "Corresponds to a short-circuiting variant of Haskell's foldM specialised to Either."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})),@@ -399,94 +398,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")),- Core.functionTypeCodomain = (Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = (Core.TypeVariable (Core.Name "y")),- Core.functionTypeCodomain = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "z")),- Core.eitherTypeRight = (Core.TypeVariable (Core.Name "x"))}))}))})),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeVariable (Core.Name "x")),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "y"))),- Typing.parameterIsLazy = False}],- Typing.termSignatureResult = Typing.Result {- Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "z")),- Core.eitherTypeRight = (Core.TypeVariable (Core.Name "x"))}))}},- Packaging.primitiveDefinitionIsPure = True,- Packaging.primitiveDefinitionIsTotal = True,- Packaging.primitiveDefinitionDefaultImplementation = (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "f"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "acc0"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "xs"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.foldl")),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "acc"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "el"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.bind")),- Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "a"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "f")),- Core.applicationArgument = (Core.TermVariable (Core.Name "a"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "el"))}))}))}))}))}))})),- Core.applicationArgument = (Core.TermEither (Right (Core.TermVariable (Core.Name "acc0"))))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "xs"))}))}))}))})))}--foldl :: Packaging.PrimitiveDefinition-foldl =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.eithers.foldl"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Left-fold over a list with an Either-returning function, short-circuiting on Left."),- Packaging.entityMetadataComments = [- "foldl(f, acc0, xs) folds f over xs from the left, threading an accumulator of type a, where each application may fail with Left e: foldl iterates while f returns Right, propagates Left on the first failure, and returns Right (final accumulator) if all elements were processed. Equivalent to chaining bind over the list.",- "Total in the sense that it terminates on finite inputs; the result is a Left whenever any application of f returns one.",- "Corresponds to a short-circuiting variant of Haskell's foldM specialised to Either."],- 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.TypeParameter {- Typing.typeParameterName = (Core.Name "z"),- Typing.typeParameterConstraints = []}],- Typing.termSignatureParameters = [- Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the Either-returning folding function"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeFunction (Core.FunctionType {@@ -496,13 +409,13 @@ Core.eitherTypeRight = (Core.TypeVariable (Core.Name "x"))}))}))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "acc0"),+ Typing.parameterDescription = (Just "the initial accumulator value"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to fold over"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "y"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -546,120 +459,6 @@ Core.applicationArgument = (Core.TermEither (Right (Core.TermVariable (Core.Name "acc0"))))})), Core.applicationArgument = (Core.TermVariable (Core.Name "xs"))}))}))}))})))} -fromLeft :: Packaging.PrimitiveDefinition-fromLeft =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.eithers.fromLeft"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Extract the Left value, or return a default."),- Packaging.entityMetadataComments = [- "fromLeft(def, e) returns the contained Left value if e is a Left, or def if e is a Right.",- "Total. Corresponds to Haskell's Data.Either.fromLeft :: a -> Either a b -> a."],- 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 "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeVariable (Core.Name "x")),- Typing.parameterIsLazy = True},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "x")),- Core.eitherTypeRight = (Core.TypeVariable (Core.Name "y"))})),- Typing.parameterIsLazy = False}],- Typing.termSignatureResult = Typing.Result {- Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeVariable (Core.Name "x"))}},- Packaging.primitiveDefinitionIsPure = True,- Packaging.primitiveDefinitionIsTotal = True,- Packaging.primitiveDefinitionDefaultImplementation = (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "def"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "e"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermVariable (Core.Name "x"))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermVariable (Core.Name "def"))}))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "e"))}))}))})))}--fromRight :: Packaging.PrimitiveDefinition-fromRight =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.eithers.fromRight"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Extract the Right value, or return a default."),- Packaging.entityMetadataComments = [- "fromRight(def, e) returns the contained Right value if e is a Right, or def if e is a Left.",- "Total. Corresponds to Haskell's Data.Either.fromRight :: b -> Either a b -> 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 "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeVariable (Core.Name "y")),- Typing.parameterIsLazy = True},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "x")),- Core.eitherTypeRight = (Core.TypeVariable (Core.Name "y"))})),- Typing.parameterIsLazy = False}],- Typing.termSignatureResult = Typing.Result {- Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeVariable (Core.Name "y"))}},- Packaging.primitiveDefinitionIsPure = True,- Packaging.primitiveDefinitionIsTotal = True,- Packaging.primitiveDefinitionDefaultImplementation = (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "def"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "e"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "_"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermVariable (Core.Name "def"))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermVariable (Core.Name "x"))}))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "e"))}))}))})))}- isLeft :: Packaging.PrimitiveDefinition isLeft = Packaging.PrimitiveDefinition {@@ -681,8 +480,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "e"),+ Typing.parameterDescription = (Just "the either value to test"), Typing.parameterType = (Core.TypeEither (Core.EitherType { Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "x")), Core.eitherTypeRight = (Core.TypeVariable (Core.Name "y"))})),@@ -730,8 +529,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "e"),+ Typing.parameterDescription = (Just "the either value to test"), Typing.parameterType = (Core.TypeEither (Core.EitherType { Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "x")), Core.eitherTypeRight = (Core.TypeVariable (Core.Name "y"))})),@@ -779,8 +578,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list of either values to extract Lefts from"), Typing.parameterType = (Core.TypeList (Core.TypeEither (Core.EitherType { Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "x")), Core.eitherTypeRight = (Core.TypeVariable (Core.Name "y"))}))),@@ -848,15 +647,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the function to apply to a Right value"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "y"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "e"),+ Typing.parameterDescription = (Just "the either value to map over"), Typing.parameterType = (Core.TypeEither (Core.EitherType { Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "z")), Core.eitherTypeRight = (Core.TypeVariable (Core.Name "x"))})),@@ -914,8 +713,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the either-returning function to apply to each element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeEither (Core.EitherType {@@ -923,8 +722,8 @@ Core.eitherTypeRight = (Core.TypeVariable (Core.Name "y"))}))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to map over"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -998,8 +797,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the either-returning function to apply to the contained value"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeEither (Core.EitherType {@@ -1007,8 +806,8 @@ Core.eitherTypeRight = (Core.TypeVariable (Core.Name "y"))}))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the optional to map over"), Typing.parameterType = (Core.TypeOptional (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1068,8 +867,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the either-returning function to apply to each element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeEither (Core.EitherType {@@ -1077,8 +876,8 @@ Core.eitherTypeRight = (Core.TypeVariable (Core.Name "y"))}))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the set to map over"), Typing.parameterType = (Core.TypeSet (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1147,7 +946,6 @@ Packaging.entityMetadataDescription = (Just "Partition a list of either values into lefts and rights."), Packaging.entityMetadataComments = [ "partition(xs) returns a pair (lefts, rights) where lefts contains every Left value from xs in original order and rights contains every Right value from xs in original order.",- "New name for partitionEithers (which is retained as a deprecated alias until the #417 breaking wave removes it).", "Total. Corresponds to Haskell's Data.Either.partitionEithers :: [Either a b] -> ([a], [b])."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})),@@ -1161,91 +959,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeList (Core.TypeEither (Core.EitherType {- Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "x")),- Core.eitherTypeRight = (Core.TypeVariable (Core.Name "y"))}))),- Typing.parameterIsLazy = False}],- Typing.termSignatureResult = Typing.Result {- Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypePair (Core.PairType {- Core.pairTypeFirst = (Core.TypeList (Core.TypeVariable (Core.Name "x"))),- Core.pairTypeSecond = (Core.TypeList (Core.TypeVariable (Core.Name "y")))}))}},- Packaging.primitiveDefinitionIsPure = True,- Packaging.primitiveDefinitionIsTotal = True,- Packaging.primitiveDefinitionDefaultImplementation = (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "xs"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.foldr")),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "e"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "acc"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.eithers.either")),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "l"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermPair (- Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.cons")),- Core.applicationArgument = (Core.TermVariable (Core.Name "l"))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.pairs.first")),- Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))}))}),- (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.pairs.second")),- Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))}))))}))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "r"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermPair (- Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.pairs.first")),- Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))}),- (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.cons")),- Core.applicationArgument = (Core.TermVariable (Core.Name "r"))})),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.pairs.second")),- Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))}))}))))}))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "e"))}))}))}))})),- Core.applicationArgument = (Core.TermPair (Core.TermList [], (Core.TermList [])))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "xs"))}))})))}--partitionEithers :: Packaging.PrimitiveDefinition-partitionEithers =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.eithers.partitionEithers"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Partition a list of either values into lefts and rights."),- Packaging.entityMetadataComments = [- "partitionEithers(xs) returns a pair (lefts, rights) where lefts contains every Left value from xs in original order and rights contains every Right value from xs in original order.",- "Total. Corresponds to Haskell's Data.Either.partitionEithers :: [Either a b] -> ([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 "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list of either values to partition"), Typing.parameterType = (Core.TypeList (Core.TypeEither (Core.EitherType { Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "x")), Core.eitherTypeRight = (Core.TypeVariable (Core.Name "y"))}))),@@ -1328,8 +1043,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value to wrap as a Right"), Typing.parameterType = (Core.TypeVariable (Core.Name "y")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1365,8 +1080,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list of either values to extract Rights from"), Typing.parameterType = (Core.TypeList (Core.TypeEither (Core.EitherType { Core.eitherTypeLeft = (Core.TypeVariable (Core.Name "x")), Core.eitherTypeRight = (Core.TypeVariable (Core.Name "y"))}))),
src/main/haskell/Hydra/Lib/Equality.hs view
@@ -36,43 +36,6 @@ import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, map, pure, sum) import qualified Data.Scientific as Sci -compare :: Packaging.PrimitiveDefinition-compare =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.equality.compare"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Compare two values and return a Comparison."),- Packaging.entityMetadataComments = [- "compare(x, y) returns the hydra.util.Comparison value that classifies the relationship between x and y under the type's ordering: LessThan if x < y, EqualTo if x == y, GreaterThan if x > y.",- "The result type's three-valued tag is the canonical primitive comparison; the boolean comparators (lt/lte/gt/gte) and equal are derivable from it.",- "Requires an 'ordering' type-class constraint on the argument type, which is the closest Hydra equivalent to Haskell's Ord instance.",- "Total. Corresponds to Haskell's compare :: Ord a => a -> a -> Ordering."],- 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 "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeVariable (Core.Name "x")),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeVariable (Core.Name "x")),- Typing.parameterIsLazy = False}],- Typing.termSignatureResult = Typing.Result {- Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeVariable (Core.Name "hydra.util.Comparison"))}},- Packaging.primitiveDefinitionIsPure = True,- Packaging.primitiveDefinitionIsTotal = True,- Packaging.primitiveDefinitionDefaultImplementation = Nothing}- equal :: Packaging.PrimitiveDefinition equal = Packaging.PrimitiveDefinition {@@ -94,189 +57,13 @@ Core.TypeClassConstraintSimple (Core.Name "equality")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeVariable (Core.Name "x")),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (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}--gt :: Packaging.PrimitiveDefinition-gt =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.equality.gt"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Check whether the first value is greater than the second."),- Packaging.entityMetadataComments = [- "gt(x, y) returns true iff x > y under the type's ordering.",- "Requires an 'ordering' constraint on the argument type.",- "Total. Corresponds to Haskell's (>) :: Ord a => a -> 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 "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeVariable (Core.Name "x")),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (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}--gte :: Packaging.PrimitiveDefinition-gte =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.equality.gte"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Check whether the first value is greater than or equal to the second."),- Packaging.entityMetadataComments = [- "gte(x, y) returns true iff x >= y under the type's ordering.",- "Requires an 'ordering' constraint on the argument type.",- "Total. Corresponds to Haskell's (>=) :: Ord a => a -> 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 "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeVariable (Core.Name "x")),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (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}--identity :: Packaging.PrimitiveDefinition-identity =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.equality.identity"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Return a value unchanged."),- Packaging.entityMetadataComments = [- "identity(x) = x. The polymorphic identity function.",- "Total. Corresponds to Haskell's id :: 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 "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeVariable (Core.Name "x")),- Typing.parameterIsLazy = False}],- Typing.termSignatureResult = Typing.Result {- Typing.resultDescription = Nothing,- Typing.resultType = (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.TermVariable (Core.Name "x"))})))}--lt :: Packaging.PrimitiveDefinition-lt =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.equality.lt"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Check whether the first value is less than the second."),- Packaging.entityMetadataComments = [- "lt(x, y) returns true iff x < y under the type's ordering.",- "Requires an 'ordering' constraint on the argument type.",- "Total. Corresponds to Haskell's (<) :: Ord a => a -> 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 "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeVariable (Core.Name "x")),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (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}--lte :: Packaging.PrimitiveDefinition-lte =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.equality.lte"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Check whether the first value is less than or equal to the second."),- Packaging.entityMetadataComments = [- "lte(x, y) returns true iff x <= y under the type's ordering.",- "Requires an 'ordering' constraint on the argument type.",- "Total. Corresponds to Haskell's (<=) :: Ord a => a -> 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 "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the first value to compare"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "y"),+ Typing.parameterDescription = (Just "the second value to compare"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -286,110 +73,6 @@ Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing} -max :: Packaging.PrimitiveDefinition-max =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.equality.max"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Return the maximum of two values."),- Packaging.entityMetadataComments = [- "max(x, y) returns the larger of x and y under the type's ordering; if x == y, it returns y (matching Haskell's convention).",- "Requires an 'ordering' constraint on the argument type.",- "Total. Corresponds to Haskell's max :: Ord a => a -> a -> a."],- 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 "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeVariable (Core.Name "x")),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeVariable (Core.Name "x")),- Typing.parameterIsLazy = False}],- Typing.termSignatureResult = Typing.Result {- Typing.resultDescription = Nothing,- Typing.resultType = (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.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "y"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.logic.ifElse")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.equality.gte")),- Core.applicationArgument = (Core.TermVariable (Core.Name "x"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "y"))}))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "x"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "y"))}))}))})))}--min :: Packaging.PrimitiveDefinition-min =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.equality.min"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Return the minimum of two values."),- Packaging.entityMetadataComments = [- "min(x, y) returns the smaller of x and y under the type's ordering; if x == y, it returns x (matching Haskell's convention).",- "Requires an 'ordering' constraint on the argument type.",- "Total. Corresponds to Haskell's min :: Ord a => a -> a -> a."],- 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 "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeVariable (Core.Name "x")),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeVariable (Core.Name "x")),- Typing.parameterIsLazy = False}],- Typing.termSignatureResult = Typing.Result {- Typing.resultDescription = Nothing,- Typing.resultType = (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.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "y"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.logic.ifElse")),- Core.applicationArgument = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.equality.lte")),- Core.applicationArgument = (Core.TermVariable (Core.Name "x"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "y"))}))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "x"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "y"))}))}))})))}- notEqual :: Packaging.PrimitiveDefinition notEqual = Packaging.PrimitiveDefinition {@@ -410,13 +93,13 @@ Core.TypeClassConstraintSimple (Core.Name "equality")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the first value to compare"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "y"),+ Typing.parameterDescription = (Just "the second value to compare"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {
src/main/haskell/Hydra/Lib/Files.hs view
@@ -50,13 +50,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "path"),+ Typing.parameterDescription = (Just "the path of the file to append to"), Typing.parameterType = (Core.TypeVariable (Core.Name "hydra.file.FilePath")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "contents"),+ Typing.parameterDescription = (Just "the raw bytes to append"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBinary), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -82,18 +82,18 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "recursive"),+ Typing.parameterDescription = (Just "whether to copy a directory tree rather than a single file"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBoolean), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "source"),+ Typing.parameterDescription = (Just "the path to copy from"), Typing.parameterType = (Core.TypeVariable (Core.Name "hydra.file.FilePath")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "destination"),+ Typing.parameterDescription = (Just "the path to copy to"), Typing.parameterType = (Core.TypeVariable (Core.Name "hydra.file.FilePath")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -119,13 +119,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "recursive"),+ Typing.parameterDescription = (Just "whether to create missing parent directories as well"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBoolean), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "path"),+ Typing.parameterDescription = (Just "the path of the directory to create"), Typing.parameterType = (Core.TypeVariable (Core.Name "hydra.file.FilePath")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -151,8 +151,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "path"),+ Typing.parameterDescription = (Just "the path to test for existence"), Typing.parameterType = (Core.TypeVariable (Core.Name "hydra.file.FilePath")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -178,8 +178,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "path"),+ Typing.parameterDescription = (Just "the path of the directory to list"), Typing.parameterType = (Core.TypeVariable (Core.Name "hydra.file.FilePath")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -205,8 +205,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "path"),+ Typing.parameterDescription = (Just "the path of the file to read"), Typing.parameterType = (Core.TypeVariable (Core.Name "hydra.file.FilePath")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -232,13 +232,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "recursive"),+ Typing.parameterDescription = (Just "whether to remove the directory's contents as well"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBoolean), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "path"),+ Typing.parameterDescription = (Just "the path of the directory to remove"), Typing.parameterType = (Core.TypeVariable (Core.Name "hydra.file.FilePath")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -264,8 +264,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "path"),+ Typing.parameterDescription = (Just "the path of the file to remove"), Typing.parameterType = (Core.TypeVariable (Core.Name "hydra.file.FilePath")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -291,13 +291,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "source"),+ Typing.parameterDescription = (Just "the path to rename from"), Typing.parameterType = (Core.TypeVariable (Core.Name "hydra.file.FilePath")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "destination"),+ Typing.parameterDescription = (Just "the path to rename to"), Typing.parameterType = (Core.TypeVariable (Core.Name "hydra.file.FilePath")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -323,8 +323,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "path"),+ Typing.parameterDescription = (Just "the path to retrieve metadata for"), Typing.parameterType = (Core.TypeVariable (Core.Name "hydra.file.FilePath")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -350,13 +350,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "path"),+ Typing.parameterDescription = (Just "the path of the file to write"), Typing.parameterType = (Core.TypeVariable (Core.Name "hydra.file.FilePath")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "contents"),+ Typing.parameterDescription = (Just "the raw bytes to write as the file's contents"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBinary), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {
src/main/haskell/Hydra/Lib/Functions.hs view
@@ -62,22 +62,22 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "g"),+ Typing.parameterDescription = (Just "the outer function, applied to the result of f"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "t2")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "t3"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the inner function, applied to x first"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "t1")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "t2"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the argument to which f is applied"), Typing.parameterType = (Core.TypeVariable (Core.Name "t1")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -122,13 +122,13 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value to return"), Typing.parameterType = (Core.TypeVariable (Core.Name "t1")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "y"),+ Typing.parameterDescription = (Just "the ignored second argument"), Typing.parameterType = (Core.TypeVariable (Core.Name "t2")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -168,8 +168,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the binary function whose argument order is swapped"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "t1")), Core.functionTypeCodomain = (Core.TypeFunction (Core.FunctionType {@@ -177,13 +177,13 @@ Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "t3"))}))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the argument passed as f's second argument"), Typing.parameterType = (Core.TypeVariable (Core.Name "t2")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "y"),+ Typing.parameterDescription = (Just "the argument passed as f's first argument"), Typing.parameterType = (Core.TypeVariable (Core.Name "t1")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -225,8 +225,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value to return unchanged"), Typing.parameterType = (Core.TypeVariable (Core.Name "t1")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {
src/main/haskell/Hydra/Lib/Hashing.hs view
@@ -51,8 +51,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "bytes"),+ Typing.parameterDescription = (Just "the sequence of bytes to hash"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBinary), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -77,8 +77,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "bytes"),+ Typing.parameterDescription = (Just "the sequence of bytes to hash"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBinary), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {
src/main/haskell/Hydra/Lib/Lists.hs view
@@ -58,15 +58,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "fs"),+ Typing.parameterDescription = (Just "the list of functions to apply"), Typing.parameterType = (Core.TypeList (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "y"))}))), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list of values to apply them to"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -84,7 +84,6 @@ Packaging.entityMetadataDescription = (Just "Return the element at the given index, or Nothing if out of bounds."), Packaging.entityMetadataComments = [ "at(i, xs) returns Just(xs[i]) if 0 <= i < length(xs), or Nothing otherwise.",- "New name for maybeAt (retained as a deprecated alias until the #417 breaking wave removes it).", "Total. Wraps the Haskell (!!) operator, which is partial, in maybe to make out-of-bounds total."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})),@@ -95,13 +94,13 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "i"),+ Typing.parameterDescription = (Just "the index to look up"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to index into"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -132,13 +131,13 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to bind over"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the function returning a list for each element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeList (Core.TypeVariable (Core.Name "y")))})),@@ -198,22 +197,22 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the first list-returning function"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeList (Core.TypeVariable (Core.Name "y")))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "g"),+ Typing.parameterDescription = (Just "the second list-returning function"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "y")), Core.functionTypeCodomain = (Core.TypeList (Core.TypeVariable (Core.Name "z")))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the input value"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -241,8 +240,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xss"),+ Typing.parameterDescription = (Just "the list of lists to concatenate"), Typing.parameterType = (Core.TypeList (Core.TypeList (Core.TypeVariable (Core.Name "x")))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -270,13 +269,13 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the first list"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "ys"),+ Typing.parameterDescription = (Just "the list to append"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -304,13 +303,13 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value to prepend"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to prepend to"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -328,7 +327,6 @@ Packaging.entityMetadataDescription = (Just "Remove duplicate elements from a list."), Packaging.entityMetadataComments = [ "distinct(xs) returns the list of distinct elements of xs, in the order of their first occurrence.",- "New name for nub (retained as a deprecated alias until the #417 breaking wave removes it).", "Requires an 'equality' constraint on the element type.", "Total. Corresponds to Haskell's Data.List.nub :: Eq a => [a] -> [a]."], Packaging.entityMetadataSeeAlso = [],@@ -341,8 +339,8 @@ Core.TypeClassConstraintSimple (Core.Name "equality")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to deduplicate"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -370,13 +368,13 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "n"),+ Typing.parameterDescription = (Just "the number of elements to drop"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to drop from"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -404,15 +402,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "p"),+ Typing.parameterDescription = (Just "the predicate to test each element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeLiteral Core.LiteralTypeBoolean)})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to drop from"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -434,42 +432,6 @@ Core.applicationArgument = (Core.TermVariable (Core.Name "p"))})), Core.applicationArgument = (Core.TermVariable (Core.Name "xs"))}))}))}))})))} -elem :: Packaging.PrimitiveDefinition-elem =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.lists.elem"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Test whether an element is in a list."),- Packaging.entityMetadataComments = [- "elem(x, xs) returns true iff some element of xs is equal to x.",- "Requires an 'equality' constraint on the element type.",- "Total. Corresponds to Haskell's elem :: Eq a => a -> [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 "equality")]}],- Typing.termSignatureParameters = [- Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeVariable (Core.Name "x")),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- 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}- filter :: Packaging.PrimitiveDefinition filter = Packaging.PrimitiveDefinition {@@ -488,15 +450,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "p"),+ Typing.parameterDescription = (Just "the predicate to test each element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeLiteral Core.LiteralTypeBoolean)})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to filter"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -554,15 +516,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "p"),+ Typing.parameterDescription = (Just "the predicate to test each element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeLiteral Core.LiteralTypeBoolean)})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to search"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -620,8 +582,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the branching step function"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeFunction (Core.FunctionType {@@ -629,13 +591,13 @@ Core.functionTypeCodomain = (Core.TypeList (Core.TypeVariable (Core.Name "x")))}))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "acc0"),+ Typing.parameterDescription = (Just "the initial accumulator"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to fold"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "y"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -667,8 +629,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the step function combining accumulator and element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "y")), Core.functionTypeCodomain = (Core.TypeFunction (Core.FunctionType {@@ -676,13 +638,13 @@ Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "y"))}))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "acc0"),+ Typing.parameterDescription = (Just "the initial accumulator"), Typing.parameterType = (Core.TypeVariable (Core.Name "y")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to fold"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -713,8 +675,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the step function combining element and accumulator"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeFunction (Core.FunctionType {@@ -722,13 +684,13 @@ Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "y"))}))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "acc0"),+ Typing.parameterDescription = (Just "the initial accumulator"), Typing.parameterType = (Core.TypeVariable (Core.Name "y")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to fold"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -758,8 +720,8 @@ Core.TypeClassConstraintSimple (Core.Name "equality")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to group"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -777,7 +739,6 @@ Packaging.entityMetadataDescription = (Just "Return the first element, or Nothing if the list is empty."), Packaging.entityMetadataComments = [ "head(xs) returns Just(x) where x is the first element of xs, or Nothing if xs is empty.",- "New name for maybeHead (retained as a deprecated alias until the #417 breaking wave removes it).", "Total. Wraps Haskell's partial head in maybe."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})),@@ -788,8 +749,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to take the head of"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -807,7 +768,6 @@ Packaging.entityMetadataDescription = (Just "Return all elements except the last, or Nothing if the list is empty."), Packaging.entityMetadataComments = [ "init(xs) returns Just(ys) where ys is xs with its last element removed, or Nothing if xs is empty.",- "New name for maybeInit (retained as a deprecated alias until the #417 breaking wave removes it).", "Total. Wraps Haskell's partial init in maybe."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})),@@ -818,8 +778,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to take the initial segment of"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -829,40 +789,6 @@ Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing} -intercalate :: Packaging.PrimitiveDefinition-intercalate =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.lists.intercalate"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Intercalate a list of lists with a separator list between each."),- Packaging.entityMetadataComments = [- "intercalate(sep, xss) returns the concatenation of xss with sep inserted between consecutive lists. Equivalent to concat(intersperse(sep, xss)).",- "Total. Corresponds to Haskell's intercalate :: [a] -> [[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 "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeList (Core.TypeList (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}- intersperse :: Packaging.PrimitiveDefinition intersperse = Packaging.PrimitiveDefinition {@@ -881,13 +807,13 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "sep"),+ Typing.parameterDescription = (Just "the separator value to insert"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to intersperse into"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -905,7 +831,6 @@ Packaging.entityMetadataDescription = (Just "Intercalate a list of lists with a separator list between each."), Packaging.entityMetadataComments = [ "join(sep, xss) returns the concatenation of xss with sep inserted between consecutive lists. Equivalent to concat(intersperse(sep, xss)).",- "New name for intercalate (retained as a deprecated alias until the #417 breaking wave removes it).", "Total. Corresponds to Haskell's intercalate :: [a] -> [[a]] -> [a]."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})),@@ -916,13 +841,13 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "sep"),+ Typing.parameterDescription = (Just "the separator list to insert"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xss"),+ Typing.parameterDescription = (Just "the list of lists to join"), Typing.parameterType = (Core.TypeList (Core.TypeList (Core.TypeVariable (Core.Name "x")))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -940,7 +865,6 @@ Packaging.entityMetadataDescription = (Just "Return the last element, or Nothing if the list is empty."), Packaging.entityMetadataComments = [ "last(xs) returns Just(x) where x is the last element of xs, or Nothing if xs is empty.",- "New name for maybeLast (retained as a deprecated alias until the #417 breaking wave removes it).", "Total. Wraps Haskell's partial last in maybe."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})),@@ -951,8 +875,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to take the last element of"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -981,8 +905,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to measure"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1013,15 +937,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the function to apply to each element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "y"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to map over"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1053,15 +977,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the list-returning function to apply to each element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeList (Core.TypeVariable (Core.Name "y")))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to traverse"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1092,15 +1016,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the list-returning function to apply"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeList (Core.TypeVariable (Core.Name "y")))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the optional value to traverse"), Typing.parameterType = (Core.TypeOptional (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1134,15 +1058,15 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the list-returning function to apply to each element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeList (Core.TypeVariable (Core.Name "y")))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the set to traverse"), Typing.parameterType = (Core.TypeSet (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1152,156 +1076,6 @@ Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing} -maybeAt :: Packaging.PrimitiveDefinition-maybeAt =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.lists.maybeAt"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Return the element at the given index, or Nothing if out of bounds."),- Packaging.entityMetadataComments = [- "maybeAt(i, xs) returns Just(xs[i]) if 0 <= i < length(xs), or Nothing otherwise.",- "Total. Wraps the Haskell (!!) operator, which is partial, in maybe to make out-of-bounds total."],- 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 "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeList (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}--maybeHead :: Packaging.PrimitiveDefinition-maybeHead =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.lists.maybeHead"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Return the first element, or Nothing if the list is empty."),- Packaging.entityMetadataComments = [- "maybeHead(xs) returns Just(x) where x is the first element of xs, or Nothing if xs is empty.",- "Total. Wraps Haskell's partial head in maybe."],- 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 "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeList (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}--maybeInit :: Packaging.PrimitiveDefinition-maybeInit =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.lists.maybeInit"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Return all elements except the last, or Nothing if the list is empty."),- Packaging.entityMetadataComments = [- "maybeInit(xs) returns Just(ys) where ys is xs with its last element removed, or Nothing if xs is empty.",- "Total. Wraps Haskell's partial init in maybe."],- 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 "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))),- Typing.parameterIsLazy = False}],- Typing.termSignatureResult = Typing.Result {- Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeOptional (Core.TypeList (Core.TypeVariable (Core.Name "x"))))}},- Packaging.primitiveDefinitionIsPure = True,- Packaging.primitiveDefinitionIsTotal = True,- Packaging.primitiveDefinitionDefaultImplementation = Nothing}--maybeLast :: Packaging.PrimitiveDefinition-maybeLast =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.lists.maybeLast"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Return the last element, or Nothing if the list is empty."),- Packaging.entityMetadataComments = [- "maybeLast(xs) returns Just(x) where x is the last element of xs, or Nothing if xs is empty.",- "Total. Wraps Haskell's partial last in maybe."],- 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 "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeList (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}--maybeTail :: Packaging.PrimitiveDefinition-maybeTail =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.lists.maybeTail"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Return all elements except the first, or Nothing if the list is empty."),- Packaging.entityMetadataComments = [- "maybeTail(xs) returns Just(ys) where ys is xs with its first element removed, or Nothing if xs is empty.",- "Total. Wraps Haskell's partial tail in maybe."],- 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 "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))),- Typing.parameterIsLazy = False}],- Typing.termSignatureResult = Typing.Result {- Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeOptional (Core.TypeList (Core.TypeVariable (Core.Name "x"))))}},- Packaging.primitiveDefinitionIsPure = True,- Packaging.primitiveDefinitionIsTotal = True,- Packaging.primitiveDefinitionDefaultImplementation = Nothing}- member :: Packaging.PrimitiveDefinition member = Packaging.PrimitiveDefinition {@@ -1310,7 +1084,6 @@ Packaging.entityMetadataDescription = (Just "Test whether an element is in a list."), Packaging.entityMetadataComments = [ "member(x, xs) returns true iff some element of xs is equal to x.",- "New name for elem (retained as a deprecated alias until the #417 breaking wave removes it).", "Requires an 'equality' constraint on the element type.", "Total. Corresponds to Haskell's elem :: Eq a => a -> [a] -> Bool."], Packaging.entityMetadataSeeAlso = [],@@ -1323,13 +1096,13 @@ Core.TypeClassConstraintSimple (Core.Name "equality")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value to look for"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to search"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1339,38 +1112,6 @@ Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing} -nub :: Packaging.PrimitiveDefinition-nub =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.lists.nub"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Remove duplicate elements from a list."),- Packaging.entityMetadataComments = [- "nub(xs) returns the list of distinct elements of xs, in the order of their first occurrence.",- "Requires an 'equality' constraint on the element type.",- "Quadratic in the length of xs in the worst case.",- "Total. Corresponds to Haskell's Data.List.nub :: Eq a => [a] -> [a]."],- Packaging.entityMetadataSeeAlso = [],- Packaging.entityMetadataLifecycle = Nothing})),- Packaging.primitiveDefinitionSignature = Typing.TermSignature {- Typing.termSignatureTypeParameters = [- Typing.TypeParameter {- Typing.typeParameterName = (Core.Name "x"),- Typing.typeParameterConstraints = [- Core.TypeClassConstraintSimple (Core.Name "equality")]}],- Typing.termSignatureParameters = [- Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeList (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}- null :: Packaging.PrimitiveDefinition null = Packaging.PrimitiveDefinition {@@ -1389,8 +1130,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ 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 {@@ -1418,15 +1159,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "p"),+ Typing.parameterDescription = (Just "the predicate to test each element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeLiteral Core.LiteralTypeBoolean)})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to partition"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1502,8 +1243,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ 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 {@@ -1531,13 +1272,13 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "n"),+ Typing.parameterDescription = (Just "the number of copies"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value to replicate"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1565,8 +1306,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to reverse"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1594,8 +1335,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value to wrap in a single-element list"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1625,8 +1366,8 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to sort"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1644,7 +1385,6 @@ Packaging.entityMetadataDescription = (Just "Sort a list using a key-extraction function."), Packaging.entityMetadataComments = [ "sortBy(f, xs) returns xs sorted in ascending order by f(x) for each element x. Sort is stable: elements with equal keys preserve their original relative order.",- "New name for sortOn (retained as a deprecated alias until the #417 breaking wave removes it).", "Requires an 'ordering' constraint on the key type.", "Total. Corresponds to Haskell's Data.List.sortOn :: Ord b => (a -> b) -> [a] -> [a]."], Packaging.entityMetadataSeeAlso = [],@@ -1660,56 +1400,15 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeFunction (Core.FunctionType {- Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")),- Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "y"))})),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeList (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}--sortOn :: Packaging.PrimitiveDefinition-sortOn =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.lists.sortOn"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Sort a list using a key-extraction function."),- Packaging.entityMetadataComments = [- "sortOn(f, xs) returns xs sorted in ascending order by f(x) for each element x. Sort is stable: elements with equal keys preserve their original relative order.",- "Requires an 'ordering' constraint on the key type.",- "Total. Corresponds to Haskell's Data.List.sortOn :: Ord b => (a -> b) -> [a] -> [a]."],- 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 = [- Core.TypeClassConstraintSimple (Core.Name "ordering")]}],- Typing.termSignatureParameters = [- Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the key-extraction function"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "y"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to sort"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1737,15 +1436,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "p"),+ Typing.parameterDescription = (Just "the predicate to test each element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeLiteral Core.LiteralTypeBoolean)})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to split"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1821,7 +1520,6 @@ Packaging.entityMetadataDescription = (Just "Return all elements except the first, or Nothing if the list is empty."), Packaging.entityMetadataComments = [ "tail(xs) returns Just(ys) where ys is xs with its first element removed, or Nothing if xs is empty.",- "New name for maybeTail (retained as a deprecated alias until the #417 breaking wave removes it).", "Total. Wraps Haskell's partial tail in maybe."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})),@@ -1832,8 +1530,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to take the tail of"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1861,13 +1559,13 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "n"),+ Typing.parameterDescription = (Just "the number of elements to take"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to take from"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1896,15 +1594,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "p"),+ Typing.parameterDescription = (Just "the predicate to test each element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeLiteral Core.LiteralTypeBoolean)})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to take from"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1944,8 +1642,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xss"),+ Typing.parameterDescription = (Just "the list of lists to transpose"), Typing.parameterType = (Core.TypeList (Core.TypeList (Core.TypeVariable (Core.Name "x")))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1973,8 +1671,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to decompose"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -2007,13 +1705,13 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the first list"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "ys"),+ Typing.parameterDescription = (Just "the second list"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "y"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -2049,8 +1747,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the combining function"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeFunction (Core.FunctionType {@@ -2058,13 +1756,13 @@ Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "z"))}))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the first list"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "ys"),+ Typing.parameterDescription = (Just "the second list"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "y"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {
src/main/haskell/Hydra/Lib/Literals.hs view
@@ -36,6 +36,32 @@ import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, map, pure, sum) import qualified Data.Scientific as Sci +base64ToBinary :: Packaging.PrimitiveDefinition+base64ToBinary =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.base64ToBinary"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Decode a base64 ASCII string to binary data."),+ Packaging.entityMetadataComments = [+ "base64ToBinary(s) decodes the standard base64 (RFC 4648) ASCII string s and returns the resulting bytes as binary data.",+ "Inverse of binaryToBase64: base64ToBinary(binaryToBase64(b)) is b for every binary value. Behavior on strings which are not valid base64 is host-defined."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the base64 string to decode"),+ Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Core.TypeLiteral Core.LiteralTypeBinary)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}+ bigintToDecimal :: Packaging.PrimitiveDefinition bigintToDecimal = Packaging.PrimitiveDefinition {@@ -51,8 +77,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the bigint to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeBigint)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -77,8 +103,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the bigint to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeBigint)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -103,8 +129,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the bigint to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeBigint)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -129,8 +155,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the bigint to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeBigint)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -155,8 +181,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the bigint to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeBigint)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -181,8 +207,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the bigint to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeBigint)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -207,8 +233,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the bigint to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeBigint)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -233,8 +259,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the bigint to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeBigint)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -259,8 +285,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the bigint to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeBigint)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -270,56 +296,55 @@ Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing} -binaryToBytes :: Packaging.PrimitiveDefinition-binaryToBytes =+binaryToBase64 :: Packaging.PrimitiveDefinition+binaryToBase64 = Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.binaryToBytes"),+ Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.binaryToBase64"), Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Convert binary data to a list of byte values."),+ Packaging.entityMetadataDescription = (Just "Encode binary data as a base64 ASCII string."), Packaging.entityMetadataComments = [- "binaryToBytes(b) returns the bytes of b as an int32 list with values in [0, 255], preserving byte order.",- "The result list element type is int32 rather than uint8 because Hydra's primitive collections work most naturally with int32 indices.",- "Total."],+ "binaryToBase64(b) encodes the bytes of b using standard base64 (RFC 4648) and returns the result as an ASCII string.",+ "Total and round-trippable: base64ToBinary(binaryToBase64(b)) is b for every binary value. Use this to embed arbitrary binary data in a string context (e.g. a JSON value). For interpreting bytes as text, use hydra.lib.text.decodeUtf8 instead."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})), Packaging.primitiveDefinitionSignature = Typing.TermSignature { Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "b"),+ Typing.parameterDescription = (Just "the binary data to encode"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBinary), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result { Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeList (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)))}},+ Typing.resultType = (Core.TypeLiteral Core.LiteralTypeString)}}, Packaging.primitiveDefinitionIsPure = True, Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing} -binaryToString :: Packaging.PrimitiveDefinition-binaryToString =+binaryToBytes :: Packaging.PrimitiveDefinition+binaryToBytes = Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.binaryToString"),+ Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.binaryToBytes"), Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Convert binary data to a UTF-8 string."),+ Packaging.entityMetadataDescription = (Just "Convert binary data to a list of byte values."), Packaging.entityMetadataComments = [- "binaryToString(b) interprets the bytes of b as a UTF-8-encoded string and returns the decoded value.",- "The behavior on invalid UTF-8 byte sequences is host-defined: most hosts substitute the replacement character U+FFFD; some may signal an error or truncate.",- "Total in the sense that it does not raise from the kernel's perspective, but the result may carry the host's replacement semantics."],+ "binaryToBytes(b) returns the bytes of b as an int32 list with values in [0, 255], preserving byte order.",+ "The result list element type is int32 rather than uint8 because Hydra's primitive collections work most naturally with int32 indices.",+ "Total."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})), Packaging.primitiveDefinitionSignature = Typing.TermSignature { Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "b"),+ Typing.parameterDescription = (Just "the binary data to convert"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBinary), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result { Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeLiteral Core.LiteralTypeString)}},+ Typing.resultType = (Core.TypeList (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)))}}, Packaging.primitiveDefinitionIsPure = True, Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing}@@ -339,8 +364,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the decimal to convert"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeDecimal), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -365,8 +390,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the decimal to convert"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeDecimal), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -391,8 +416,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the decimal to convert"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeDecimal), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -417,8 +442,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the float32 to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -443,8 +468,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the float32 to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -469,8 +494,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the float64 to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -495,8 +520,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the float64 to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -521,8 +546,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the int16 to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt16)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -547,8 +572,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the int32 to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -573,8 +598,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the int64 to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -599,8 +624,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the int8 to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt8)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -610,15 +635,14 @@ Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing} -readBigint :: Packaging.PrimitiveDefinition-readBigint =+parseBoolean :: Packaging.PrimitiveDefinition+parseBoolean = Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.readBigint"),+ Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.parseBoolean"), Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Parse a string as a bigint."),+ Packaging.entityMetadataDescription = (Just "Parse a string as a boolean."), 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.",+ "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})),@@ -626,25 +650,104 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ 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.LiteralTypeInteger Core.IntegerTypeBigint)))}},+ Typing.resultType = (Core.TypeOptional (Core.TypeLiteral Core.LiteralTypeBoolean))}}, Packaging.primitiveDefinitionIsPure = True, Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing} -readBoolean :: Packaging.PrimitiveDefinition-readBoolean =+parseString :: Packaging.PrimitiveDefinition+parseString = Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.readBoolean"),+ Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.parseString"), Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Parse a string as a boolean."),+ Packaging.entityMetadataDescription = (Just "Parse a string-literal token to a plain string (Just) or Nothing on parse failure."), Packaging.entityMetadataComments = [- "readBoolean(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).",+ "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 {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Core.Name "s"),+ 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.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)}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++printString :: Packaging.PrimitiveDefinition+printString =+ Packaging.PrimitiveDefinition {+ 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}++readBigint :: Packaging.PrimitiveDefinition+readBigint =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.readBigint"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Parse a string as a bigint."),+ 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.", "Total."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})),@@ -652,13 +755,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ 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.LiteralTypeBoolean))}},+ Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeBigint)))}}, Packaging.primitiveDefinitionIsPure = True, Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing}@@ -679,8 +782,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -706,8 +809,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -733,8 +836,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -759,8 +862,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -785,8 +888,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -811,8 +914,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -837,8 +940,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -848,32 +951,6 @@ Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing} -readString :: Packaging.PrimitiveDefinition-readString =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.readString"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Parse a string-literal token to a plain string (Just) or Nothing on parse failure."),- Packaging.entityMetadataComments = [- "readString(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 showString."],- Packaging.entityMetadataSeeAlso = [],- Packaging.entityMetadataLifecycle = Nothing})),- Packaging.primitiveDefinitionSignature = Typing.TermSignature {- Typing.termSignatureTypeParameters = [],- Typing.termSignatureParameters = [- Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,- 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}- readUint16 :: Packaging.PrimitiveDefinition readUint16 = Packaging.PrimitiveDefinition {@@ -889,8 +966,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -915,8 +992,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -941,8 +1018,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -967,8 +1044,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to parse"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -993,8 +1070,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ 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 {@@ -1004,32 +1081,6 @@ Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing} -showBoolean :: Packaging.PrimitiveDefinition-showBoolean =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.showBoolean"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Render a boolean as a string."),- Packaging.entityMetadataComments = [- "showBoolean(true) = \"true\"; showBoolean(false) = \"false\".",- "Total. The inverse of readBoolean."],- Packaging.entityMetadataSeeAlso = [],- Packaging.entityMetadataLifecycle = Nothing})),- Packaging.primitiveDefinitionSignature = Typing.TermSignature {- Typing.termSignatureTypeParameters = [],- Typing.termSignatureParameters = [- Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBoolean),- 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}- showDecimal :: Packaging.PrimitiveDefinition showDecimal = Packaging.PrimitiveDefinition {@@ -1045,8 +1096,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the decimal to render"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeDecimal), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1071,8 +1122,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the float32 to render"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1097,8 +1148,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the float64 to render"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1123,8 +1174,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the int16 to render"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt16)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1149,8 +1200,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the int32 to render"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1175,8 +1226,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the int64 to render"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1201,8 +1252,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the int8 to render"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt8)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1212,32 +1263,6 @@ Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing} -showString :: Packaging.PrimitiveDefinition-showString =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.showString"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Render a string as a string-literal token (escaped and quoted)."),- Packaging.entityMetadataComments = [- "showString(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 readString."],- Packaging.entityMetadataSeeAlso = [],- Packaging.entityMetadataLifecycle = Nothing})),- Packaging.primitiveDefinitionSignature = Typing.TermSignature {- Typing.termSignatureTypeParameters = [],- Typing.termSignatureParameters = [- Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,- 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}- showUint16 :: Packaging.PrimitiveDefinition showUint16 = Packaging.PrimitiveDefinition {@@ -1253,8 +1278,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the uint16 to render"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeUint16)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1279,8 +1304,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the uint32 to render"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeUint32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1305,8 +1330,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the uint64 to render"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeUint64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1331,8 +1356,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the uint8 to render"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeUint8)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1342,32 +1367,6 @@ Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing} -stringToBinary :: Packaging.PrimitiveDefinition-stringToBinary =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.literals.stringToBinary"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Convert a UTF-8 string to binary data."),- Packaging.entityMetadataComments = [- "stringToBinary(s) encodes s as a UTF-8 byte sequence and returns the result as binary data.",- "Total."],- Packaging.entityMetadataSeeAlso = [],- Packaging.entityMetadataLifecycle = Nothing})),- Packaging.primitiveDefinitionSignature = Typing.TermSignature {- Typing.termSignatureTypeParameters = [],- Typing.termSignatureParameters = [- Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString),- Typing.parameterIsLazy = False}],- Typing.termSignatureResult = Typing.Result {- Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeLiteral Core.LiteralTypeBinary)}},- Packaging.primitiveDefinitionIsPure = True,- Packaging.primitiveDefinitionIsTotal = True,- Packaging.primitiveDefinitionDefaultImplementation = Nothing}- uint16ToBigint :: Packaging.PrimitiveDefinition uint16ToBigint = Packaging.PrimitiveDefinition {@@ -1383,8 +1382,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the uint16 to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeUint16)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1409,8 +1408,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the uint32 to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeUint32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1435,8 +1434,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the uint64 to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeUint64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1461,8 +1460,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the uint8 to convert"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeUint8)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {
src/main/haskell/Hydra/Lib/Logic.hs view
@@ -52,13 +52,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "p"),+ Typing.parameterDescription = (Just "the first boolean operand"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBoolean), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "q"),+ Typing.parameterDescription = (Just "the second boolean operand"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBoolean), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -99,18 +99,18 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "p"),+ Typing.parameterDescription = (Just "the boolean condition"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBoolean), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "t"),+ Typing.parameterDescription = (Just "the value returned when p is true"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = True}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the value returned when p is false"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = True}], Typing.termSignatureResult = Typing.Result {@@ -135,8 +135,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "p"),+ Typing.parameterDescription = (Just "the boolean value to negate"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBoolean), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -171,13 +171,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "p"),+ Typing.parameterDescription = (Just "the first boolean operand"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBoolean), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "q"),+ Typing.parameterDescription = (Just "the second boolean operand"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBoolean), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {
src/main/haskell/Hydra/Lib/Maps.hs view
@@ -60,20 +60,20 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the update function, applied to the optional current value at the key"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeOptional (Core.TypeVariable (Core.Name "v"))), Core.functionTypeCodomain = (Core.TypeOptional (Core.TypeVariable (Core.Name "v")))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "k"),+ Typing.parameterDescription = (Just "the key whose binding to alter"), Typing.parameterType = (Core.TypeVariable (Core.Name "k")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the map to update"), Typing.parameterType = (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))})),@@ -152,22 +152,22 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "fk"),+ Typing.parameterDescription = (Just "the function to apply to each key"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "k1")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "k2"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "fv"),+ Typing.parameterDescription = (Just "the function to apply to each value"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "v1")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "v2"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the map to transform"), Typing.parameterType = (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k1")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v1"))})),@@ -234,13 +234,13 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "k"),+ Typing.parameterDescription = (Just "the key to remove"), Typing.parameterType = (Core.TypeVariable (Core.Name "k")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the map to remove the key from"), Typing.parameterType = (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))})),@@ -278,15 +278,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m1"),+ Typing.parameterDescription = (Just "the map whose bindings are retained"), Typing.parameterType = (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m2"),+ Typing.parameterDescription = (Just "the map whose keys are subtracted"), Typing.parameterType = (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))})),@@ -323,8 +323,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the map whose values to return"), Typing.parameterType = (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))})),@@ -390,15 +390,15 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "p"),+ Typing.parameterDescription = (Just "the predicate to test each value"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "v")), Core.functionTypeCodomain = (Core.TypeLiteral Core.LiteralTypeBoolean)})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the map to filter"), Typing.parameterType = (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))})),@@ -456,8 +456,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "p"),+ Typing.parameterDescription = (Just "the predicate to test each key and value"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "k")), Core.functionTypeCodomain = (Core.TypeFunction (Core.FunctionType {@@ -465,8 +465,8 @@ Core.functionTypeCodomain = (Core.TypeLiteral Core.LiteralTypeBoolean)}))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the map to filter"), Typing.parameterType = (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))})),@@ -528,18 +528,18 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "def"),+ Typing.parameterDescription = (Just "the default value, returned when the key is absent"), Typing.parameterType = (Core.TypeVariable (Core.Name "v")), Typing.parameterIsLazy = True}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "k"),+ Typing.parameterDescription = (Just "the key to look up"), Typing.parameterType = (Core.TypeVariable (Core.Name "k")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the map to search"), Typing.parameterType = (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))})),@@ -560,7 +560,7 @@ Core.lambdaDomain = Nothing, Core.lambdaBody = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.fromOptional")),+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.withDefault")), Core.applicationArgument = (Core.TermVariable (Core.Name "def"))})), Core.applicationArgument = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application {@@ -591,8 +591,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list of key-value pairs to build the map from"), Typing.parameterType = (Core.TypeList (Core.TypePair (Core.PairType { Core.pairTypeFirst = (Core.TypeVariable (Core.Name "k")), Core.pairTypeSecond = (Core.TypeVariable (Core.Name "v"))}))),@@ -629,18 +629,18 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "k"),+ Typing.parameterDescription = (Just "the key to insert"), Typing.parameterType = (Core.TypeVariable (Core.Name "k")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "v"),+ Typing.parameterDescription = (Just "the value to bind to the key"), Typing.parameterType = (Core.TypeVariable (Core.Name "v")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the map to insert into"), Typing.parameterType = (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))})),@@ -678,15 +678,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m1"),+ Typing.parameterDescription = (Just "the map whose bindings are retained"), Typing.parameterType = (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m2"),+ Typing.parameterDescription = (Just "the map whose key set is intersected"), Typing.parameterType = (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))})),@@ -723,8 +723,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the map whose keys to return"), Typing.parameterType = (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))})),@@ -759,13 +759,13 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "k"),+ Typing.parameterDescription = (Just "the key to look up"), Typing.parameterType = (Core.TypeVariable (Core.Name "k")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the map to search"), Typing.parameterType = (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))})),@@ -803,15 +803,15 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the function to apply to each value"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "v1")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "v2"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the map to transform"), Typing.parameterType = (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v1"))})),@@ -877,15 +877,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the function to apply to each key"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "k1")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "k2"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the map to transform"), Typing.parameterType = (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k1")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))})),@@ -947,13 +947,13 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "k"),+ Typing.parameterDescription = (Just "the key to test for"), Typing.parameterType = (Core.TypeVariable (Core.Name "k")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ 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"))})),@@ -988,8 +988,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ 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"))})),@@ -1024,13 +1024,13 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "k"),+ Typing.parameterDescription = (Just "the key of the single binding"), Typing.parameterType = (Core.TypeVariable (Core.Name "k")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "v"),+ Typing.parameterDescription = (Just "the value of the single binding"), Typing.parameterType = (Core.TypeVariable (Core.Name "v")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1065,8 +1065,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the map whose bindings to count"), Typing.parameterType = (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))})),@@ -1101,8 +1101,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the map to convert"), Typing.parameterType = (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))})),@@ -1139,15 +1139,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m1"),+ Typing.parameterDescription = (Just "the map whose bindings take precedence"), Typing.parameterType = (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m2"),+ Typing.parameterDescription = (Just "the map whose remaining bindings are added"), Typing.parameterType = (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))})),@@ -1185,8 +1185,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "ms"),+ Typing.parameterDescription = (Just "the list of maps to combine"), Typing.parameterType = (Core.TypeList (Core.TypeMap (Core.MapType { Core.mapTypeKeys = (Core.TypeVariable (Core.Name "k")), Core.mapTypeValues = (Core.TypeVariable (Core.Name "v"))}))),
src/main/haskell/Hydra/Lib/Math.hs view
@@ -52,8 +52,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the integer whose absolute value is taken"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -79,8 +79,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the cosine value whose arc cosine is computed"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -106,8 +106,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value whose inverse hyperbolic cosine is computed"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -122,28 +122,33 @@ Packaging.PrimitiveDefinition { Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.math.add"), Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Integer addition."),+ Packaging.entityMetadataDescription = (Just "Numeric addition."), Packaging.entityMetadataComments = [- "Two's-complement 32-bit signed integer addition. The result is x + y reduced modulo 2^32 and reinterpreted as a signed int32 (i.e. arithmetic wraps silently on overflow, with no exception raised).",- "The operation is total. Corresponds to Haskell's (+) :: Int32 -> Int32 -> Int32."],+ "Constraint-polymorphic addition over any type with a 'numeric' instance. The per-type semantics live in the instance: two's-complement wraparound for fixed-width integers (e.g. int32 addition reduces x + y modulo 2^32 and reinterprets as signed, wrapping silently on overflow), IEEE 754 round-to-nearest for floating-point, and arbitrary precision for bigint.",+ "Requires a 'numeric' type-class constraint on the argument type, which is the closest Hydra equivalent to Haskell's Num instance.",+ "The operation is total. Corresponds to Haskell's (+) :: Num a => a -> a -> a."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})), Packaging.primitiveDefinitionSignature = Typing.TermSignature {- Typing.termSignatureTypeParameters = [],+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Core.Name "x"),+ Typing.typeParameterConstraints = [+ Core.TypeClassConstraintSimple (Core.Name "numeric")]}], Typing.termSignatureParameters = [ Typing.Parameter { Typing.parameterName = (Core.Name "arg0"), Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),+ Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}, Typing.Parameter { Typing.parameterName = (Core.Name "arg1"), Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),+ Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result { Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32))}},+ Typing.resultType = (Core.TypeVariable (Core.Name "x"))}}, Packaging.primitiveDefinitionIsPure = True, Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing}@@ -164,13 +169,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the first addend"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "y"),+ Typing.parameterDescription = (Just "the second addend"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -196,8 +201,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the sine value whose arc sine is computed"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -222,8 +227,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value whose inverse hyperbolic sine is computed"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -248,8 +253,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the tangent value whose arc tangent is computed"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -275,13 +280,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "y"),+ Typing.parameterDescription = (Just "the ordinate (y-coordinate)"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the abscissa (x-coordinate)"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -306,8 +311,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value whose inverse hyperbolic tangent is computed"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -333,8 +338,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value to round up toward positive infinity"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -359,8 +364,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the angle in radians"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -385,8 +390,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value whose hyperbolic cosine is computed"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -396,6 +401,39 @@ Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing} +div :: Packaging.PrimitiveDefinition+div =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.math.div"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Integer division, or Nothing if dividing by zero."),+ Packaging.entityMetadataComments = [+ "Total integer division: div(x, y) returns Just(x divided by y, rounded toward negative infinity) when y is non-zero, and Nothing when y = 0.",+ "The division rounds toward negative infinity (floor), so for example div(-7, 2) = Just(-4).",+ "The boundary case div(minBound, -1), whose mathematical result +2147483648 is not representable in int32, wraps to minBound (the two's-complement overflow).",+ "Corresponds to Haskell's div :: Int32 -> Int32 -> Int32, wrapped in maybe to make the zero-divisor case total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the dividend"),+ Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Core.Name "y"),+ Typing.parameterDescription = (Just "the divisor"),+ Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}+ e :: Packaging.PrimitiveDefinition e = Packaging.PrimitiveDefinition {@@ -432,8 +470,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the integer to test for evenness"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -449,11 +487,11 @@ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.equality.equal")), Core.applicationArgument = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.fromOptional")),+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.withDefault")), Core.applicationArgument = (Core.TermLiteral (Core.LiteralInteger (Core.IntegerValueInt32 0)))})), Core.applicationArgument = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.maybeMod")),+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.math.mod")), Core.applicationArgument = (Core.TermVariable (Core.Name "x"))})), Core.applicationArgument = (Core.TermLiteral (Core.LiteralInteger (Core.IntegerValueInt32 2)))}))}))})), Core.applicationArgument = (Core.TermLiteral (Core.LiteralInteger (Core.IntegerValueInt32 0)))}))})))}@@ -473,8 +511,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the exponent"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -500,8 +538,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value to round down toward negative infinity"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -526,8 +564,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value whose natural logarithm is computed"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -553,13 +591,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "b"),+ Typing.parameterDescription = (Just "the logarithm base"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value whose logarithm is computed"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -569,79 +607,15 @@ Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing} -max :: Packaging.PrimitiveDefinition-max =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.math.max"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "The maximum of two integers."),- Packaging.entityMetadataComments = [- "Return the larger of two int32 values under the usual signed-integer total order.",- "Total on all inputs. Corresponds to Haskell's max :: Int32 -> Int32 -> Int32."],- Packaging.entityMetadataSeeAlso = [],- Packaging.entityMetadataLifecycle = Nothing})),- Packaging.primitiveDefinitionSignature = Typing.TermSignature {- Typing.termSignatureTypeParameters = [],- Typing.termSignatureParameters = [- Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),- Typing.parameterIsLazy = False}],- Typing.termSignatureResult = Typing.Result {- Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32))}},- Packaging.primitiveDefinitionIsPure = True,- Packaging.primitiveDefinitionIsTotal = True,- Packaging.primitiveDefinitionDefaultImplementation = Nothing}--maybeDiv :: Packaging.PrimitiveDefinition-maybeDiv =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.math.maybeDiv"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Integer division, or Nothing if dividing by zero."),- Packaging.entityMetadataComments = [- "Total integer division: maybeDiv(x, y) returns Just(x divided by y, rounded toward negative infinity) when y is non-zero, and Nothing when y = 0.",- "The division rounds toward negative infinity (floor), so for example maybeDiv(-7, 2) = Just(-4).",- "The boundary case maybeDiv(minBound, -1), whose mathematical result +2147483648 is not representable in int32, wraps to minBound (the two's-complement overflow).",- "Corresponds to Haskell's div :: Int32 -> Int32 -> Int32, wrapped in maybe to make the zero-divisor case total."],- Packaging.entityMetadataSeeAlso = [],- Packaging.entityMetadataLifecycle = Nothing})),- Packaging.primitiveDefinitionSignature = Typing.TermSignature {- Typing.termSignatureTypeParameters = [],- Typing.termSignatureParameters = [- Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),- Typing.parameterIsLazy = False}],- Typing.termSignatureResult = Typing.Result {- Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)))}},- Packaging.primitiveDefinitionIsPure = True,- Packaging.primitiveDefinitionIsTotal = True,- Packaging.primitiveDefinitionDefaultImplementation = Nothing}--maybeMod :: Packaging.PrimitiveDefinition-maybeMod =+mod :: Packaging.PrimitiveDefinition+mod = Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.math.maybeMod"),+ Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.math.mod"), Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata { Packaging.entityMetadataDescription = (Just "Integer modulus, or Nothing if dividing by zero."), Packaging.entityMetadataComments = [- "Total integer modulus: maybeMod(x, y) returns Just(x mod y) when y is non-zero, and Nothing when y = 0.",- "The result satisfies the identity x = (maybeDiv(x, y) result) * y + (maybeMod(x, y) result), so the sign of the result matches the sign of y (Knuth-style floor division). For example maybeMod(-7, 2) = Just(1).",+ "Total integer modulus: mod(x, y) returns Just(x mod y) when y is non-zero, and Nothing when y = 0.",+ "The result satisfies the identity x = (div(x, y) result) * y + (mod(x, y) result), so the sign of the result matches the sign of y (Knuth-style floor division). For example mod(-7, 2) = Just(1).", "Corresponds to Haskell's mod :: Int32 -> Int32 -> Int32, wrapped in maybe to make the zero-divisor case total."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})),@@ -649,98 +623,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),- Typing.parameterIsLazy = False}],- Typing.termSignatureResult = Typing.Result {- Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)))}},- Packaging.primitiveDefinitionIsPure = True,- Packaging.primitiveDefinitionIsTotal = True,- Packaging.primitiveDefinitionDefaultImplementation = Nothing}--maybePred :: Packaging.PrimitiveDefinition-maybePred =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.math.maybePred"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "The predecessor of an integer, or Nothing on underflow."),- Packaging.entityMetadataComments = [- "maybePred(x) returns Just(x - 1) when x > minBound, and Nothing when x = minBound (i.e. -2147483648). The function is total and does not wrap.",- "Corresponds to Haskell's pred :: Int32 -> Int32, wrapped in maybe to make the boundary case total (Haskell's pred is a partial function that raises an error on minBound)."],- Packaging.entityMetadataSeeAlso = [],- Packaging.entityMetadataLifecycle = Nothing})),- Packaging.primitiveDefinitionSignature = Typing.TermSignature {- Typing.termSignatureTypeParameters = [],- Typing.termSignatureParameters = [- Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),- Typing.parameterIsLazy = False}],- Typing.termSignatureResult = Typing.Result {- Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)))}},- Packaging.primitiveDefinitionIsPure = True,- Packaging.primitiveDefinitionIsTotal = True,- Packaging.primitiveDefinitionDefaultImplementation = Nothing}--maybeRem :: Packaging.PrimitiveDefinition-maybeRem =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.math.maybeRem"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Integer remainder, or Nothing if dividing by zero."),- Packaging.entityMetadataComments = [- "Total integer remainder: maybeRem(x, y) returns Just(x rem y) when y is non-zero, and Nothing when y = 0.",- "The result satisfies x = (truncate(x / y)) * y + (maybeRem(x, y) result), so the sign of the result matches the sign of x (truncated division, C-style remainder). For example maybeRem(-7, 2) = Just(-1).",- "The boundary case maybeRem(minBound, -1) is 0 (no overflow, since the quotient overflow is absorbed).",- "Corresponds to Haskell's rem :: Int32 -> Int32 -> Int32, wrapped in maybe to make the zero-divisor case total."],- Packaging.entityMetadataSeeAlso = [],- Packaging.entityMetadataLifecycle = Nothing})),- Packaging.primitiveDefinitionSignature = Typing.TermSignature {- Typing.termSignatureTypeParameters = [],- Typing.termSignatureParameters = [- Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the dividend"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),- Typing.parameterIsLazy = False}],- Typing.termSignatureResult = Typing.Result {- Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)))}},- Packaging.primitiveDefinitionIsPure = True,- Packaging.primitiveDefinitionIsTotal = True,- Packaging.primitiveDefinitionDefaultImplementation = Nothing}--maybeSucc :: Packaging.PrimitiveDefinition-maybeSucc =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.math.maybeSucc"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "The successor of an integer, or Nothing on overflow."),- Packaging.entityMetadataComments = [- "maybeSucc(x) returns Just(x + 1) when x < maxBound, and Nothing when x = maxBound (i.e. 2147483647). The function is total and does not wrap.",- "Corresponds to Haskell's succ :: Int32 -> Int32, wrapped in maybe to make the boundary case total (Haskell's succ is a partial function that raises an error on maxBound)."],- Packaging.entityMetadataSeeAlso = [],- Packaging.entityMetadataLifecycle = Nothing})),- Packaging.primitiveDefinitionSignature = Typing.TermSignature {- Typing.termSignatureTypeParameters = [],- Typing.termSignatureParameters = [- Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "y"),+ Typing.parameterDescription = (Just "the divisor"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -750,64 +639,38 @@ Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing} -min :: Packaging.PrimitiveDefinition-min =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.math.min"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "The minimum of two integers."),- Packaging.entityMetadataComments = [- "Return the smaller of two int32 values under the usual signed-integer total order.",- "Total on all inputs. Corresponds to Haskell's min :: Int32 -> Int32 -> Int32."],- Packaging.entityMetadataSeeAlso = [],- Packaging.entityMetadataLifecycle = Nothing})),- Packaging.primitiveDefinitionSignature = Typing.TermSignature {- Typing.termSignatureTypeParameters = [],- Typing.termSignatureParameters = [- Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),- Typing.parameterIsLazy = False}],- Typing.termSignatureResult = Typing.Result {- Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32))}},- Packaging.primitiveDefinitionIsPure = True,- Packaging.primitiveDefinitionIsTotal = True,- Packaging.primitiveDefinitionDefaultImplementation = Nothing}- mul :: Packaging.PrimitiveDefinition mul = Packaging.PrimitiveDefinition { Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.math.mul"), Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Integer multiplication."),+ Packaging.entityMetadataDescription = (Just "Numeric multiplication."), Packaging.entityMetadataComments = [- "Two's-complement 32-bit signed integer multiplication. The result is x * y reduced modulo 2^32 and reinterpreted as a signed int32 (i.e. arithmetic wraps silently on overflow, with no exception raised).",- "The operation is total. Corresponds to Haskell's (*) :: Int32 -> Int32 -> Int32."],+ "Constraint-polymorphic multiplication over any type with a 'numeric' instance. The per-type semantics live in the instance: two's-complement wraparound for fixed-width integers (e.g. int32 multiplication reduces x * y modulo 2^32 and reinterprets as signed, wrapping silently on overflow), IEEE 754 round-to-nearest for floating-point, and arbitrary precision for bigint.",+ "Requires a 'numeric' type-class constraint on the argument type.",+ "The operation is total. Corresponds to Haskell's (*) :: Num a => a -> a -> a."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})), Packaging.primitiveDefinitionSignature = Typing.TermSignature {- Typing.termSignatureTypeParameters = [],+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Core.Name "x"),+ Typing.typeParameterConstraints = [+ Core.TypeClassConstraintSimple (Core.Name "numeric")]}], Typing.termSignatureParameters = [ Typing.Parameter { Typing.parameterName = (Core.Name "arg0"), Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),+ Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}, Typing.Parameter { Typing.parameterName = (Core.Name "arg1"), Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),+ Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result { Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32))}},+ Typing.resultType = (Core.TypeVariable (Core.Name "x"))}}, Packaging.primitiveDefinitionIsPure = True, Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing}@@ -828,13 +691,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the first factor"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "y"),+ Typing.parameterDescription = (Just "the second factor"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -849,24 +712,28 @@ Packaging.PrimitiveDefinition { Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.math.negate"), Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Negate an integer."),+ Packaging.entityMetadataDescription = (Just "Numeric negation."), Packaging.entityMetadataComments = [- "Arithmetic negation of a 32-bit signed integer. The result is 0 - x reduced modulo 2^32 and reinterpreted as a signed int32.",- "The function is total but not injective at the boundary: negate(minBound) = minBound (i.e. negate(-2147483648) = -2147483648), because +2147483648 is not representable in int32.",- "Corresponds to Haskell's negate :: Int32 -> Int32."],+ "Constraint-polymorphic arithmetic negation over any type with a 'numeric' instance. The per-type semantics live in the instance: for fixed-width integers the result is 0 - x reduced modulo 2^32 and reinterpreted as signed (total but not injective at the boundary: negate(minBound) = minBound, because +2147483648 is not representable in int32); for floating-point it flips the sign bit per IEEE 754 \2677.5.1.",+ "Requires a 'numeric' type-class constraint on the argument type.",+ "Corresponds to Haskell's negate :: Num a => a -> a."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})), Packaging.primitiveDefinitionSignature = Typing.TermSignature {- Typing.termSignatureTypeParameters = [],+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Core.Name "x"),+ Typing.typeParameterConstraints = [+ Core.TypeClassConstraintSimple (Core.Name "numeric")]}], Typing.termSignatureParameters = [ Typing.Parameter { Typing.parameterName = (Core.Name "arg0"), Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),+ Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result { Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32))}},+ Typing.resultType = (Core.TypeVariable (Core.Name "x"))}}, Packaging.primitiveDefinitionIsPure = True, Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing}@@ -886,8 +753,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value to negate"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -912,8 +779,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the integer to test for oddness"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -967,13 +834,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the base"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "y"),+ Typing.parameterDescription = (Just "the exponent"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -998,13 +865,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "a"),+ Typing.parameterDescription = (Just "the inclusive lower bound of the range"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "b"),+ Typing.parameterDescription = (Just "the inclusive upper bound of the range"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1014,6 +881,39 @@ Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing} +rem :: Packaging.PrimitiveDefinition+rem =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.math.rem"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Integer remainder, or Nothing if dividing by zero."),+ Packaging.entityMetadataComments = [+ "Total integer remainder: rem(x, y) returns Just(x rem y) when y is non-zero, and Nothing when y = 0.",+ "The result satisfies x = (truncate(x / y)) * y + (rem(x, y) result), so the sign of the result matches the sign of x (truncated division, C-style remainder). For example rem(-7, 2) = Just(-1).",+ "The boundary case rem(minBound, -1) is 0 (no overflow, since the quotient overflow is absorbed).",+ "Corresponds to Haskell's rem :: Int32 -> Int32 -> Int32, wrapped in maybe to make the zero-divisor case total."],+ Packaging.entityMetadataSeeAlso = [],+ Packaging.entityMetadataLifecycle = Nothing})),+ Packaging.primitiveDefinitionSignature = Typing.TermSignature {+ Typing.termSignatureTypeParameters = [],+ Typing.termSignatureParameters = [+ Typing.Parameter {+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the dividend"),+ Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Core.Name "y"),+ Typing.parameterDescription = (Just "the divisor"),+ Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Core.TypeOptional (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}+ round :: Packaging.PrimitiveDefinition round = Packaging.PrimitiveDefinition {@@ -1030,8 +930,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value to round to the nearest integer"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1057,13 +957,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "n"),+ Typing.parameterDescription = (Just "the number of decimal places to round to"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the float32 value to round"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1089,13 +989,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "n"),+ Typing.parameterDescription = (Just "the number of decimal places to round to"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the float64 value to round"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1121,8 +1021,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the integer whose sign is returned"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1147,8 +1047,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the angle in radians"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1173,8 +1073,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value whose hyperbolic sine is computed"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1200,8 +1100,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value whose square root is computed"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1216,28 +1116,33 @@ Packaging.PrimitiveDefinition { Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.math.sub"), Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Integer subtraction."),+ Packaging.entityMetadataDescription = (Just "Numeric subtraction."), Packaging.entityMetadataComments = [- "Two's-complement 32-bit signed integer subtraction. The result is x - y reduced modulo 2^32 and reinterpreted as a signed int32 (i.e. arithmetic wraps silently on overflow, with no exception raised).",- "The operation is total. Corresponds to Haskell's (-) :: Int32 -> Int32 -> Int32."],+ "Constraint-polymorphic subtraction over any type with a 'numeric' instance. The per-type semantics live in the instance: two's-complement wraparound for fixed-width integers (e.g. int32 subtraction reduces x - y modulo 2^32 and reinterprets as signed, wrapping silently on overflow), IEEE 754 round-to-nearest for floating-point, and arbitrary precision for bigint.",+ "Requires a 'numeric' type-class constraint on the argument type.",+ "The operation is total. Corresponds to Haskell's (-) :: Num a => a -> a -> a."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})), Packaging.primitiveDefinitionSignature = Typing.TermSignature {- Typing.termSignatureTypeParameters = [],+ Typing.termSignatureTypeParameters = [+ Typing.TypeParameter {+ Typing.typeParameterName = (Core.Name "x"),+ Typing.typeParameterConstraints = [+ Core.TypeClassConstraintSimple (Core.Name "numeric")]}], Typing.termSignatureParameters = [ Typing.Parameter { Typing.parameterName = (Core.Name "arg0"), Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),+ Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}, Typing.Parameter { Typing.parameterName = (Core.Name "arg1"), Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),+ Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result { Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32))}},+ Typing.resultType = (Core.TypeVariable (Core.Name "x"))}}, Packaging.primitiveDefinitionIsPure = True, Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing}@@ -1258,13 +1163,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the minuend"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "y"),+ Typing.parameterDescription = (Just "the subtrahend"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1289,8 +1194,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the angle in radians"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1315,8 +1220,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value whose hyperbolic tangent is computed"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -1342,8 +1247,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value to truncate toward zero"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeFloat Core.FloatTypeFloat64)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {
src/main/haskell/Hydra/Lib/Optionals.hs view
@@ -58,15 +58,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "mf"),+ Typing.parameterDescription = (Just "the optional function"), Typing.parameterType = (Core.TypeOptional (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "y"))}))), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "mx"),+ Typing.parameterDescription = (Just "the optional argument"), Typing.parameterType = (Core.TypeOptional (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -120,13 +120,13 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the optional value to bind"), Typing.parameterType = (Core.TypeOptional (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the continuation to apply to the contained value"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeOptional (Core.TypeVariable (Core.Name "y")))})),@@ -172,18 +172,18 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the optional value to eliminate"), Typing.parameterType = (Core.TypeOptional (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "def"),+ Typing.parameterDescription = (Just "the value to return when the optional is none"), Typing.parameterType = (Core.TypeVariable (Core.Name "y")), Typing.parameterIsLazy = True}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the function to apply to the contained value when the optional is given"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "y"))})),@@ -195,63 +195,6 @@ Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing} -cat :: Packaging.PrimitiveDefinition-cat =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.optionals.cat"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Concatenate optionals, keeping only the present values."),- Packaging.entityMetadataComments = [- "cat(xs) returns the list of contained values from given elements of xs, in original order; none elements are discarded.",- "Total. Corresponds to Haskell's Data.Maybe.catMaybes :: [Maybe 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 "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeList (Core.TypeOptional (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 = (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "xs"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.foldr")),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "m"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "acc"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.cases")),- Core.applicationArgument = (Core.TermVariable (Core.Name "m"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "v"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.cons")),- Core.applicationArgument = (Core.TermVariable (Core.Name "v"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))}))}))}))}))}))})),- Core.applicationArgument = (Core.TermList [])})),- Core.applicationArgument = (Core.TermVariable (Core.Name "xs"))}))})))}- compose :: Packaging.PrimitiveDefinition compose = Packaging.PrimitiveDefinition {@@ -277,22 +220,22 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the first Kleisli arrow"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeOptional (Core.TypeVariable (Core.Name "y")))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "g"),+ Typing.parameterDescription = (Just "the second Kleisli arrow"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "y")), Core.functionTypeCodomain = (Core.TypeOptional (Core.TypeVariable (Core.Name "z")))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the value to apply the composition to"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -339,8 +282,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the optional-returning step function"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeFunction (Core.FunctionType {@@ -348,13 +291,13 @@ Core.functionTypeCodomain = (Core.TypeOptional (Core.TypeVariable (Core.Name "x")))}))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "acc"),+ Typing.parameterDescription = (Just "the initial accumulator"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to fold over"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "y"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -398,55 +341,6 @@ Core.applicationArgument = (Core.TermVariable (Core.Name "acc"))}))})), Core.applicationArgument = (Core.TermVariable (Core.Name "xs"))}))}))}))})))} -fromOptional :: Packaging.PrimitiveDefinition-fromOptional =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.optionals.fromOptional"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Return the value contained in an optional, falling back to a default if absent."),- Packaging.entityMetadataComments = [- "fromOptional(def, m) returns x when m is given(x), and def when m is none.",- "Total. Corresponds to Haskell's Data.Maybe.fromMaybe :: a -> Maybe 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 "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeVariable (Core.Name "x")),- Typing.parameterIsLazy = True},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeOptional (Core.TypeVariable (Core.Name "x"))),- Typing.parameterIsLazy = False}],- Typing.termSignatureResult = Typing.Result {- Typing.resultDescription = Nothing,- Typing.resultType = (Core.TypeVariable (Core.Name "x"))}},- Packaging.primitiveDefinitionIsPure = True,- Packaging.primitiveDefinitionIsTotal = True,- Packaging.primitiveDefinitionDefaultImplementation = (Just (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "def"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "m"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.cases")),- Core.applicationArgument = (Core.TermVariable (Core.Name "m"))})),- Core.applicationArgument = (Core.TermVariable (Core.Name "def"))})),- Core.applicationArgument = (Core.TermLambda (Core.Lambda {- Core.lambdaParameter = (Core.Name "x"),- Core.lambdaDomain = Nothing,- Core.lambdaBody = (Core.TermVariable (Core.Name "x"))}))}))}))})))}- givens :: Packaging.PrimitiveDefinition givens = Packaging.PrimitiveDefinition {@@ -455,7 +349,6 @@ Packaging.entityMetadataDescription = (Just "Concatenate optionals, keeping only the present values."), Packaging.entityMetadataComments = [ "givens(xs) returns the list of contained values from given elements of xs, in original order; none elements are discarded.",- "New name for cat (retained as a deprecated alias until the #417 breaking wave removes it).", "Total. Corresponds to Haskell's Data.Maybe.catMaybes :: [Maybe a] -> [a]."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})),@@ -466,8 +359,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list of optionals to concatenate"), Typing.parameterType = (Core.TypeList (Core.TypeOptional (Core.TypeVariable (Core.Name "x")))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -523,8 +416,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the optional to test"), Typing.parameterType = (Core.TypeOptional (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -564,8 +457,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the optional to test"), Typing.parameterType = (Core.TypeOptional (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -609,15 +502,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the function to apply to the contained value"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "y"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the optional to map over"), Typing.parameterType = (Core.TypeOptional (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -665,15 +558,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the optional-returning function to apply to each element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeOptional (Core.TypeVariable (Core.Name "y")))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to traverse"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -744,15 +637,15 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the partial function to apply to each element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeOptional (Core.TypeVariable (Core.Name "y")))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list to map over"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -767,7 +660,7 @@ Core.lambdaParameter = (Core.Name "xs"), Core.lambdaDomain = Nothing, Core.lambdaBody = (Core.TermApplication (Core.Application {- Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.cat")),+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.optionals.givens")), Core.applicationArgument = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermApplication (Core.Application { Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.lists.map")),@@ -798,15 +691,15 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the optional-returning function to apply to each element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeOptional (Core.TypeVariable (Core.Name "y")))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the set to traverse"), Typing.parameterType = (Core.TypeSet (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -885,8 +778,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ 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 {@@ -917,8 +810,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the optional to convert"), Typing.parameterType = (Core.TypeOptional (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -949,7 +842,6 @@ Packaging.entityMetadataDescription = (Just "Return the value contained in an optional, falling back to a default if absent."), Packaging.entityMetadataComments = [ "withDefault(def, m) returns x when m is given(x), and def when m is none.",- "New name for fromOptional (retained as a deprecated alias until the #417 breaking wave removes it).", "Total. Corresponds to Haskell's Data.Maybe.fromMaybe :: a -> Maybe a -> a."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})),@@ -960,13 +852,13 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "def"),+ Typing.parameterDescription = (Just "the default value to return when the optional is none"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = True}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "m"),+ Typing.parameterDescription = (Just "the optional to unwrap"), Typing.parameterType = (Core.TypeOptional (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {
+ src/main/haskell/Hydra/Lib/Ordering.hs view
@@ -0,0 +1,329 @@+-- Note: this is an automatically generated file. Do not edit.++-- | Primitives in the hydra.lib.ordering module.++module Hydra.Lib.Ordering 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.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.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, map, pure, sum)+import qualified Data.Scientific as Sci++compare :: Packaging.PrimitiveDefinition+compare =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.ordering.compare"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Compare two values and return a Comparison."),+ Packaging.entityMetadataComments = [+ "compare(x, y) returns the hydra.util.Comparison value that classifies the relationship between x and y under the type's ordering: LessThan if x < y, EqualTo if x == y, GreaterThan if x > y.",+ "The result type's three-valued tag is the canonical primitive comparison; the boolean comparators (lt/lte/gt/gte) are derivable from it.",+ "Requires an 'ordering' type-class constraint on the argument type, which is the closest Hydra equivalent to Haskell's Ord instance.",+ "Since: 0.18 (moved from hydra.lib.equality.compare).",+ "Total. Corresponds to Haskell's compare :: Ord a => a -> a -> Ordering."],+ 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 "x"),+ Typing.parameterDescription = (Just "the first value to compare"),+ Typing.parameterType = (Core.TypeVariable (Core.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Core.Name "y"),+ Typing.parameterDescription = (Just "the second value to compare"),+ Typing.parameterType = (Core.TypeVariable (Core.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (Core.TypeVariable (Core.Name "hydra.util.Comparison"))}},+ Packaging.primitiveDefinitionIsPure = True,+ Packaging.primitiveDefinitionIsTotal = True,+ Packaging.primitiveDefinitionDefaultImplementation = Nothing}++gt :: Packaging.PrimitiveDefinition+gt =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.ordering.gt"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Check whether the first value is greater than the second."),+ Packaging.entityMetadataComments = [+ "gt(x, y) returns true iff x > y under the type's ordering.",+ "Requires an 'ordering' constraint on the argument type.",+ "Since: 0.18 (moved from hydra.lib.equality.gt).",+ "Total. Corresponds to Haskell's (>) :: Ord a => a -> 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 "x"),+ Typing.parameterDescription = (Just "the first value to compare"),+ Typing.parameterType = (Core.TypeVariable (Core.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Core.Name "y"),+ Typing.parameterDescription = (Just "the second value to compare"),+ Typing.parameterType = (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}++gte :: Packaging.PrimitiveDefinition+gte =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.ordering.gte"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Check whether the first value is greater than or equal to the second."),+ Packaging.entityMetadataComments = [+ "gte(x, y) returns true iff x >= y under the type's ordering.",+ "Requires an 'ordering' constraint on the argument type.",+ "Since: 0.18 (moved from hydra.lib.equality.gte).",+ "Total. Corresponds to Haskell's (>=) :: Ord a => a -> 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 "x"),+ Typing.parameterDescription = (Just "the first value to compare"),+ Typing.parameterType = (Core.TypeVariable (Core.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Core.Name "y"),+ Typing.parameterDescription = (Just "the second value to compare"),+ Typing.parameterType = (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}++lt :: Packaging.PrimitiveDefinition+lt =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.ordering.lt"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Check whether the first value is less than the second."),+ Packaging.entityMetadataComments = [+ "lt(x, y) returns true iff x < y under the type's ordering.",+ "Requires an 'ordering' constraint on the argument type.",+ "Since: 0.18 (moved from hydra.lib.equality.lt).",+ "Total. Corresponds to Haskell's (<) :: Ord a => a -> 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 "x"),+ Typing.parameterDescription = (Just "the first value to compare"),+ Typing.parameterType = (Core.TypeVariable (Core.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Core.Name "y"),+ Typing.parameterDescription = (Just "the second value to compare"),+ Typing.parameterType = (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}++lte :: Packaging.PrimitiveDefinition+lte =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.ordering.lte"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Check whether the first value is less than or equal to the second."),+ Packaging.entityMetadataComments = [+ "lte(x, y) returns true iff x <= y under the type's ordering.",+ "Requires an 'ordering' constraint on the argument type.",+ "Since: 0.18 (moved from hydra.lib.equality.lte).",+ "Total. Corresponds to Haskell's (<=) :: Ord a => a -> 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 "x"),+ Typing.parameterDescription = (Just "the first value to compare"),+ Typing.parameterType = (Core.TypeVariable (Core.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Core.Name "y"),+ Typing.parameterDescription = (Just "the second value to compare"),+ Typing.parameterType = (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}++max :: Packaging.PrimitiveDefinition+max =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.ordering.max"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Return the maximum of two values."),+ Packaging.entityMetadataComments = [+ "max(x, y) returns the larger of x and y under the type's ordering; if x == y, it returns y (matching Haskell's convention).",+ "Requires an 'ordering' constraint on the argument type.",+ "Since: 0.18 (moved from hydra.lib.equality.max).",+ "Total. Corresponds to Haskell's max :: Ord a => a -> a -> a."],+ 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 "x"),+ Typing.parameterDescription = (Just "the first value to compare"),+ Typing.parameterType = (Core.TypeVariable (Core.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Core.Name "y"),+ Typing.parameterDescription = (Just "the second value to compare"),+ Typing.parameterType = (Core.TypeVariable (Core.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (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.TermLambda (Core.Lambda {+ Core.lambdaParameter = (Core.Name "y"),+ Core.lambdaDomain = Nothing,+ Core.lambdaBody = (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.logic.ifElse")),+ Core.applicationArgument = (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.ordering.gte")),+ Core.applicationArgument = (Core.TermVariable (Core.Name "x"))})),+ Core.applicationArgument = (Core.TermVariable (Core.Name "y"))}))})),+ Core.applicationArgument = (Core.TermVariable (Core.Name "x"))})),+ Core.applicationArgument = (Core.TermVariable (Core.Name "y"))}))}))})))}++min :: Packaging.PrimitiveDefinition+min =+ Packaging.PrimitiveDefinition {+ Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.ordering.min"),+ Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {+ Packaging.entityMetadataDescription = (Just "Return the minimum of two values."),+ Packaging.entityMetadataComments = [+ "min(x, y) returns the smaller of x and y under the type's ordering; if x == y, it returns x (matching Haskell's convention).",+ "Requires an 'ordering' constraint on the argument type.",+ "Since: 0.18 (moved from hydra.lib.equality.min).",+ "Total. Corresponds to Haskell's min :: Ord a => a -> a -> a."],+ 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 "x"),+ Typing.parameterDescription = (Just "the first value to compare"),+ Typing.parameterType = (Core.TypeVariable (Core.Name "x")),+ Typing.parameterIsLazy = False},+ Typing.Parameter {+ Typing.parameterName = (Core.Name "y"),+ Typing.parameterDescription = (Just "the second value to compare"),+ Typing.parameterType = (Core.TypeVariable (Core.Name "x")),+ Typing.parameterIsLazy = False}],+ Typing.termSignatureResult = Typing.Result {+ Typing.resultDescription = Nothing,+ Typing.resultType = (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.TermLambda (Core.Lambda {+ Core.lambdaParameter = (Core.Name "y"),+ Core.lambdaDomain = Nothing,+ Core.lambdaBody = (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.logic.ifElse")),+ Core.applicationArgument = (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermApplication (Core.Application {+ Core.applicationFunction = (Core.TermVariable (Core.Name "hydra.lib.ordering.lte")),+ Core.applicationArgument = (Core.TermVariable (Core.Name "x"))})),+ Core.applicationArgument = (Core.TermVariable (Core.Name "y"))}))})),+ Core.applicationArgument = (Core.TermVariable (Core.Name "x"))})),+ Core.applicationArgument = (Core.TermVariable (Core.Name "y"))}))}))})))}
src/main/haskell/Hydra/Lib/Pairs.hs view
@@ -63,22 +63,22 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the function applied to the first element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "a")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "c"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "g"),+ Typing.parameterDescription = (Just "the function applied to the second element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "b")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "d"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "p"),+ Typing.parameterDescription = (Just "the pair to map over"), Typing.parameterType = (Core.TypePair (Core.PairType { Core.pairTypeFirst = (Core.TypeVariable (Core.Name "a")), Core.pairTypeSecond = (Core.TypeVariable (Core.Name "b"))})),@@ -132,8 +132,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "p"),+ Typing.parameterDescription = (Just "the pair whose first element is returned"), Typing.parameterType = (Core.TypePair (Core.PairType { Core.pairTypeFirst = (Core.TypeVariable (Core.Name "a")), Core.pairTypeSecond = (Core.TypeVariable (Core.Name "b"))})),@@ -166,8 +166,8 @@ Typing.typeParameterConstraints = []}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "p"),+ Typing.parameterDescription = (Just "the pair whose second element is returned"), Typing.parameterType = (Core.TypePair (Core.PairType { Core.pairTypeFirst = (Core.TypeVariable (Core.Name "a")), Core.pairTypeSecond = (Core.TypeVariable (Core.Name "b"))})),
src/main/haskell/Hydra/Lib/Regex.hs view
@@ -52,13 +52,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "pat"),+ Typing.parameterDescription = (Just "the regex pattern to search for"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to search within"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -84,13 +84,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "pat"),+ Typing.parameterDescription = (Just "the regex pattern to search for"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to search within"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -116,13 +116,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "pat"),+ Typing.parameterDescription = (Just "the regex pattern to test"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to test against"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -149,18 +149,18 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "pat"),+ Typing.parameterDescription = (Just "the regex pattern to match"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "repl"),+ Typing.parameterDescription = (Just "the replacement string"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to operate on"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -186,18 +186,18 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "pat"),+ Typing.parameterDescription = (Just "the regex pattern to match"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "repl"),+ Typing.parameterDescription = (Just "the replacement string"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg2"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to operate on"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -224,13 +224,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "pat"),+ Typing.parameterDescription = (Just "the regex pattern to split on"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to split"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {
src/main/haskell/Hydra/Lib/Sets.hs view
@@ -56,13 +56,13 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the element to remove"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the set to remove the element from"), Typing.parameterType = (Core.TypeSet (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -92,13 +92,13 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s1"),+ Typing.parameterDescription = (Just "the set to subtract from"), Typing.parameterType = (Core.TypeSet (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s2"),+ Typing.parameterDescription = (Just "the set of elements to remove"), Typing.parameterType = (Core.TypeSet (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -188,15 +188,15 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "predicate"),+ Typing.parameterDescription = (Just "the predicate to test each element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeLiteral Core.LiteralTypeBoolean)})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the set to filter"), Typing.parameterType = (Core.TypeSet (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -240,8 +240,8 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list of elements to build the set from"), Typing.parameterType = (Core.TypeList (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -271,13 +271,13 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the element to add"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the set to add the element to"), Typing.parameterType = (Core.TypeSet (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -307,13 +307,13 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s1"),+ Typing.parameterDescription = (Just "the first set"), Typing.parameterType = (Core.TypeSet (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s2"),+ Typing.parameterDescription = (Just "the second set"), Typing.parameterType = (Core.TypeSet (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -381,15 +381,15 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "f"),+ Typing.parameterDescription = (Just "the function to apply to each element"), Typing.parameterType = (Core.TypeFunction (Core.FunctionType { Core.functionTypeDomain = (Core.TypeVariable (Core.Name "x")), Core.functionTypeCodomain = (Core.TypeVariable (Core.Name "y"))})), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the set to map over"), Typing.parameterType = (Core.TypeSet (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -433,13 +433,13 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the element to test for membership"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ 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 {@@ -469,8 +469,8 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ 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 {@@ -500,8 +500,8 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "x"),+ Typing.parameterDescription = (Just "the single element of the set"), Typing.parameterType = (Core.TypeVariable (Core.Name "x")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -531,8 +531,8 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the set whose size is returned"), Typing.parameterType = (Core.TypeSet (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -562,8 +562,8 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the set to convert to a list"), Typing.parameterType = (Core.TypeSet (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -593,13 +593,13 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s1"),+ Typing.parameterDescription = (Just "the first set"), Typing.parameterType = (Core.TypeSet (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s2"),+ Typing.parameterDescription = (Just "the second set"), Typing.parameterType = (Core.TypeSet (Core.TypeVariable (Core.Name "x"))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -653,8 +653,8 @@ Core.TypeClassConstraintSimple (Core.Name "ordering")]}], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "ss"),+ Typing.parameterDescription = (Just "the list of sets to union together"), Typing.parameterType = (Core.TypeList (Core.TypeSet (Core.TypeVariable (Core.Name "x")))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {
src/main/haskell/Hydra/Lib/Strings.hs view
@@ -36,63 +36,6 @@ import Prelude hiding (Enum, Ordering, decodeFloat, encodeFloat, fail, map, pure, sum) import qualified Data.Scientific as Sci -cat :: Packaging.PrimitiveDefinition-cat =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.strings.cat"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Concatenate a list of strings into a single string."),- Packaging.entityMetadataComments = [- "cat(xs) returns the string formed by concatenating every string in xs in order.",- "Total. Corresponds to Haskell's concat :: [String] -> String."],- Packaging.entityMetadataSeeAlso = [],- Packaging.entityMetadataLifecycle = Nothing})),- Packaging.primitiveDefinitionSignature = Typing.TermSignature {- Typing.termSignatureTypeParameters = [],- Typing.termSignatureParameters = [- Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeList (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}--cat2 :: Packaging.PrimitiveDefinition-cat2 =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.strings.cat2"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Concatenate two strings."),- Packaging.entityMetadataComments = [- "cat2(s, t) returns the concatenation of s and t.",- "Total. Corresponds to Haskell's (++) :: String -> String -> String."],- Packaging.entityMetadataSeeAlso = [],- Packaging.entityMetadataLifecycle = Nothing})),- Packaging.primitiveDefinitionSignature = Typing.TermSignature {- Typing.termSignatureTypeParameters = [],- Typing.termSignatureParameters = [- Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- 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}- charAt :: Packaging.PrimitiveDefinition charAt = Packaging.PrimitiveDefinition {@@ -101,7 +44,6 @@ Packaging.entityMetadataDescription = (Just "Get the Unicode code point of the character at a specific index, returning Nothing if out of bounds."), Packaging.entityMetadataComments = [ "charAt(i, s) returns Just(c) where c is the Unicode code point at position i in s, or Nothing if i is negative or i >= length(s).",- "New name for maybeCharAt (retained as a deprecated alias until the #417 breaking wave removes it).", "Total."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})),@@ -109,13 +51,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "i"),+ Typing.parameterDescription = (Just "the index of the character to retrieve"), Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to index into"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -133,7 +75,6 @@ Packaging.entityMetadataDescription = (Just "Concatenate a list of strings into a single string."), Packaging.entityMetadataComments = [ "concat(xs) returns the string formed by concatenating every string in xs in order.",- "New name for cat (retained as a deprecated alias until the #417 breaking wave removes it).", "Total. Corresponds to Haskell's concat :: [String] -> String."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})),@@ -141,8 +82,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list of strings to concatenate"), Typing.parameterType = (Core.TypeList (Core.TypeLiteral Core.LiteralTypeString)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -160,7 +101,6 @@ Packaging.entityMetadataDescription = (Just "Concatenate two strings."), Packaging.entityMetadataComments = [ "concat2(s, t) returns the concatenation of s and t.",- "New name for cat2 (retained as a deprecated alias until the #417 breaking wave removes it).", "Total. Corresponds to Haskell's (++) :: String -> String -> String."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})),@@ -168,13 +108,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the first string"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "t"),+ Typing.parameterDescription = (Just "the second string"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -200,8 +140,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "cs"),+ Typing.parameterDescription = (Just "the list of Unicode code points to convert"), Typing.parameterType = (Core.TypeList (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32))), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -211,37 +151,6 @@ Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing} -intercalate :: Packaging.PrimitiveDefinition-intercalate =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.strings.intercalate"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Join a list of strings with a separator between each element."),- Packaging.entityMetadataComments = [- "intercalate(sep, xs) returns the strings in xs concatenated with sep inserted between each pair of adjacent strings; for the empty list the result is the empty string, and for a singleton list the result is the single string.",- "Total. Corresponds to Haskell's Data.List.intercalate :: String -> [String] -> String."],- Packaging.entityMetadataSeeAlso = [],- Packaging.entityMetadataLifecycle = Nothing})),- Packaging.primitiveDefinitionSignature = Typing.TermSignature {- Typing.termSignatureTypeParameters = [],- Typing.termSignatureParameters = [- Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeList (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}- join :: Packaging.PrimitiveDefinition join = Packaging.PrimitiveDefinition {@@ -250,7 +159,6 @@ Packaging.entityMetadataDescription = (Just "Join a list of strings with a separator between each element."), Packaging.entityMetadataComments = [ "join(sep, xs) returns the strings in xs concatenated with sep inserted between each pair of adjacent strings; for the empty list the result is the empty string, and for a singleton list the result is the single string.",- "New name for intercalate (retained as a deprecated alias until the #417 breaking wave removes it).", "Total. Corresponds to Haskell's Data.List.intercalate :: String -> [String] -> String."], Packaging.entityMetadataSeeAlso = [], Packaging.entityMetadataLifecycle = Nothing})),@@ -258,13 +166,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "sep"),+ Typing.parameterDescription = (Just "the separator to insert between elements"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list of strings to join"), Typing.parameterType = (Core.TypeList (Core.TypeLiteral Core.LiteralTypeString)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -290,8 +198,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to measure"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -317,8 +225,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to split into lines"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -328,37 +236,6 @@ Packaging.primitiveDefinitionIsTotal = True, Packaging.primitiveDefinitionDefaultImplementation = Nothing} -maybeCharAt :: Packaging.PrimitiveDefinition-maybeCharAt =- Packaging.PrimitiveDefinition {- Packaging.primitiveDefinitionName = (Core.Name "hydra.lib.strings.maybeCharAt"),- Packaging.primitiveDefinitionMetadata = (Just (Packaging.EntityMetadata {- Packaging.entityMetadataDescription = (Just "Get the Unicode code point of the character at a specific index, returning Nothing if out of bounds."),- Packaging.entityMetadataComments = [- "maybeCharAt(i, s) returns Just(c) where c is the Unicode code point at position i in s, or Nothing if i is negative or i >= length(s).",- "Total."],- Packaging.entityMetadataSeeAlso = [],- Packaging.entityMetadataLifecycle = Nothing})),- Packaging.primitiveDefinitionSignature = Typing.TermSignature {- Typing.termSignatureTypeParameters = [],- Typing.termSignatureParameters = [- Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,- Typing.parameterType = (Core.TypeLiteral (Core.LiteralTypeInteger Core.IntegerTypeInt32)),- Typing.parameterIsLazy = False},- Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,- 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.IntegerTypeInt32)))}},- Packaging.primitiveDefinitionIsPure = True,- Packaging.primitiveDefinitionIsTotal = True,- Packaging.primitiveDefinitionDefaultImplementation = Nothing}- null :: Packaging.PrimitiveDefinition null = Packaging.PrimitiveDefinition {@@ -374,8 +251,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ 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 {@@ -401,13 +278,13 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "sep"),+ Typing.parameterDescription = (Just "the delimiter to split on"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}, Typing.Parameter {- Typing.parameterName = (Core.Name "arg1"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to split"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -432,8 +309,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to convert"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -460,8 +337,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to convert to lowercase"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -488,8 +365,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "s"),+ Typing.parameterDescription = (Just "the string to convert to uppercase"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -514,8 +391,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "xs"),+ Typing.parameterDescription = (Just "the list of strings to join with newlines"), Typing.parameterType = (Core.TypeList (Core.TypeLiteral Core.LiteralTypeString)), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {
src/main/haskell/Hydra/Lib/System.hs view
@@ -50,8 +50,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "command"),+ Typing.parameterDescription = (Just "the program and arguments to run"), Typing.parameterType = (Core.TypeVariable (Core.Name "hydra.system.Command")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -77,8 +77,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "code"),+ Typing.parameterDescription = (Just "the status code to terminate the process with"), Typing.parameterType = (Core.TypeVariable (Core.Name "hydra.system.StatusCode")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -124,8 +124,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "name"),+ Typing.parameterDescription = (Just "the name of the environment variable to look up"), Typing.parameterType = (Core.TypeVariable (Core.Name "hydra.system.EnvironmentVariable")), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -213,8 +213,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "bytes"),+ Typing.parameterDescription = (Just "the raw bytes to write to standard error"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBinary), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -240,8 +240,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "bytes"),+ Typing.parameterDescription = (Just "the raw bytes to write to standard output"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBinary), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {
src/main/haskell/Hydra/Lib/Text.hs view
@@ -51,8 +51,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "bytes"),+ Typing.parameterDescription = (Just "the byte sequence to decode as UTF-8"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeBinary), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {@@ -79,8 +79,8 @@ Typing.termSignatureTypeParameters = [], Typing.termSignatureParameters = [ Typing.Parameter {- Typing.parameterName = (Core.Name "arg0"),- Typing.parameterDescription = Nothing,+ Typing.parameterName = (Core.Name "text"),+ Typing.parameterDescription = (Just "the text to encode as UTF-8"), Typing.parameterType = (Core.TypeLiteral Core.LiteralTypeString), Typing.parameterIsLazy = False}], Typing.termSignatureResult = Typing.Result {
src/main/haskell/Hydra/Names.hs view
@@ -57,7 +57,7 @@ let tryLabel = \index ->- let candidate = Logic.ifElse (Equality.equal index 1) label (Strings.cat2 label (Literals.showInt32 index))+ let candidate = Logic.ifElse (Equality.equal index 1) label (Strings.concat2 label (Literals.showInt32 index)) in (Logic.ifElse (Sets.member candidate reserved) (tryLabel (Math.add index 1)) candidate) in (tryLabel 1) @@ -68,7 +68,7 @@ let qualName = qualifyName name mns = Util.qualifiedNameModuleName qualName local = Util.qualifiedNameLocal qualName- in (Optionals.cases mns (Core.unName name) (\ns -> Optionals.cases (Maps.lookup ns namespaces) local (\pre -> Strings.cat [+ in (Optionals.cases mns (Core.unName name) (\ns -> Optionals.cases (Maps.lookup ns namespaces) local (\pre -> Strings.concat [ pre, ":", local])))@@ -83,13 +83,13 @@ derivedDefinitionName categoryPrefix alwaysDropFirst prefixWhenNoNamespace n localName = let localResult = Core.Name localName- prefixedResult = Core.Name (Strings.intercalate "." (Lists.concat2 categoryPrefix [+ prefixedResult = Core.Name (Strings.join "." (Lists.concat2 categoryPrefix [ localName])) noNamespaceResult = Logic.ifElse prefixWhenNoNamespace prefixedResult localResult- in (Optionals.cases (Lists.maybeInit (Strings.splitOn "." (Core.unName n))) noNamespaceResult (\nsParts -> Optionals.cases (Lists.uncons nsParts) noNamespaceResult (\nsHeadTail ->+ in (Optionals.cases (Lists.init (Strings.splitOn "." (Core.unName n))) noNamespaceResult (\nsParts -> Optionals.cases (Lists.uncons nsParts) noNamespaceResult (\nsHeadTail -> let categoryPrefixResolved = Logic.ifElse (Logic.or alwaysDropFirst (Equality.equal (Pairs.first nsHeadTail) "hydra")) (Lists.concat2 categoryPrefix (Pairs.second nsHeadTail)) (Lists.concat2 categoryPrefix nsParts)- in (Core.Name (Strings.intercalate "." (Lists.concat2 categoryPrefixResolved [+ in (Core.Name (Strings.join "." (Lists.concat2 categoryPrefixResolved [ localName])))))) -- | Generate a derived module name from a source module name, given the category's namespace segments@@ -97,8 +97,8 @@ derivedModuleName categoryPrefix alwaysDropFirst ns = let parts = Strings.splitOn "." (Packaging.unModuleName ns)- fallback = Packaging.ModuleName (Strings.intercalate "." (Lists.concat2 categoryPrefix parts))- in (Optionals.cases (Lists.uncons parts) fallback (\ht -> Logic.ifElse (Logic.or alwaysDropFirst (Equality.equal (Pairs.first ht) "hydra")) (Packaging.ModuleName (Strings.intercalate "." (Lists.concat2 categoryPrefix (Pairs.second ht)))) fallback))+ fallback = Packaging.ModuleName (Strings.join "." (Lists.concat2 categoryPrefix parts))+ in (Optionals.cases (Lists.uncons parts) fallback (\ht -> Logic.ifElse (Logic.or alwaysDropFirst (Equality.equal (Pairs.first ht) "hydra")) (Packaging.ModuleName (Strings.join "." (Lists.concat2 categoryPrefix (Pairs.second ht)))) fallback)) -- | Generate a fresh type variable name, threading InferenceContext freshName :: Typing.InferenceContext -> (Core.Name, Typing.InferenceContext)@@ -138,7 +138,7 @@ moduleNameToFilePath caseConv ext ns = let parts = Lists.map (Formatting.convertCase Util.CaseConventionCamel caseConv) (Strings.splitOn "." (Packaging.unModuleName ns))- in (Strings.cat2 (Strings.cat2 (Strings.intercalate "/" parts) ".") (File.unFileExtension ext))+ in (Strings.concat2 (Strings.concat2 (Strings.join "/" parts) ".") (File.unFileExtension ext)) -- | Convert a name to file path, given case conventions for namespaces and local names, and assuming '/' as the file path separator nameToFilePath :: Util.CaseConvention -> Util.CaseConvention -> File.FileExtension -> Core.Name -> String@@ -148,10 +148,10 @@ ns = Util.qualifiedNameModuleName qualName local = Util.qualifiedNameLocal qualName nsToFilePath =- \nsArg -> Strings.intercalate "/" (Lists.map (\part -> Formatting.convertCase Util.CaseConventionCamel nsConv part) (Strings.splitOn "." (Packaging.unModuleName nsArg)))- prefix = Optionals.cases ns "" (\n -> Strings.cat2 (nsToFilePath n) "/")+ \nsArg -> Strings.join "/" (Lists.map (\part -> Formatting.convertCase Util.CaseConventionCamel nsConv part) (Strings.splitOn "." (Packaging.unModuleName nsArg)))+ prefix = Optionals.cases ns "" (\n -> Strings.concat2 (nsToFilePath n) "/") suffix = Formatting.convertCase Util.CaseConventionPascal localConv local- in (Strings.cat [+ in (Strings.concat [ prefix, suffix, ".",@@ -159,7 +159,7 @@ -- | Type variable naming convention follows Haskell: t0, t1, etc. normalTypeVariable :: Int -> Core.Name-normalTypeVariable i = Core.Name (Strings.cat2 "t" (Literals.showInt32 i))+normalTypeVariable i = Core.Name (Strings.concat2 "t" (Literals.showInt32 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@@ -171,7 +171,7 @@ -- | Construct a qualified (dot-separated) name qname :: Packaging.ModuleName -> String -> Core.Name qname ns name =- Core.Name (Strings.cat [+ Core.Name (Strings.concat [ Packaging.unModuleName ns, ".", name])@@ -189,7 +189,7 @@ in (Logic.ifElse (Lists.null restReversed) (Util.QualifiedName { Util.qualifiedNameModuleName = Nothing, Util.qualifiedNameLocal = (Core.unName name)}) (Util.QualifiedName {- Util.qualifiedNameModuleName = (Just (Packaging.ModuleName (Strings.intercalate "." (Lists.reverse restReversed)))),+ Util.qualifiedNameModuleName = (Just (Packaging.ModuleName (Strings.join "." (Lists.reverse restReversed)))), Util.qualifiedNameLocal = localName})))) -- | Restore the original trace from baseCx, while keeping the freshTypeVariableCount from newCx. Used between sibling sub-inferences (e.g. application LHS vs RHS) so that an error in the second sibling doesn't include the first sibling's trace path. Returns a new InferenceContext.@@ -203,5 +203,5 @@ unqualifyName :: Util.QualifiedName -> Core.Name unqualifyName qname = - let prefix = Optionals.cases (Util.qualifiedNameModuleName qname) "" (\n -> Strings.cat2 (Packaging.unModuleName n) ".")- in (Core.Name (Strings.cat2 prefix (Util.qualifiedNameLocal qname)))+ let prefix = Optionals.cases (Util.qualifiedNameModuleName qname) "" (\n -> Strings.concat2 (Packaging.unModuleName n) ".")+ in (Core.Name (Strings.concat2 prefix (Util.qualifiedNameLocal qname)))
src/main/haskell/Hydra/Overlay/Haskell/Dsl/Prims.hs view
@@ -58,15 +58,6 @@ encode _cx g = ExtractCore.boolean g decode _cx = Right . Terms.boolean --- | Build a TypeScheme from type variables and a type--- Uses polyConstrained if there are any constraints, otherwise poly-buildTypeScheme :: [TypeVar] -> Type -> TypeScheme-buildTypeScheme vars typ =- let constraints = typeVarsToConstraints vars- in if L.null constraints- then Types.poly (typeVarNames vars) typ- else Types.polyConstrained (fmap (\tv -> (typeVarName tv, typeVarClasses tv)) vars) typ- instance IsString (TermCoder Term) where fromString = variable comparison :: TermCoder Comparison@@ -92,19 +83,6 @@ -- directly, e.g. @prim2 DefMath.add ...@) is defined in 'Hydra.Overlay.Haskell.Dsl.Terms' to avoid an import cycle -- and re-exported here for the registry/DSL modules. --- | Synthesize a minimal PrimitiveDefinition from a name and TypeScheme.--- Used by the prim0/prim1/prim2/prim3 helpers to bridge the kernel-shape change--- before the per-primitive metadata audit (description, isPure/isTotal exceptions,--- defaultImplementation) is performed.-defaultPrimitiveDefinition :: Name -> TypeScheme -> PrimitiveDefinition-defaultPrimitiveDefinition name typ = PrimitiveDefinition {- primitiveDefinitionName = name,- primitiveDefinitionSignature = typeSchemeToTermSignature typ,- primitiveDefinitionMetadata = Nothing,- primitiveDefinitionIsPure = True,- primitiveDefinitionIsTotal = True,- primitiveDefinitionDefaultImplementation = Nothing}- -- | Convert a TypeScheme to a TermSignature. A convenience alias for -- typeSchemeToTermSignature, used by primitive-declaration source modules. sig :: TypeScheme -> Typing.TermSignature@@ -298,12 +276,6 @@ otherErr :: Typing.InferenceContext -> String -> Error.Error otherErr _cx msg = Error.ErrorOther (Error.OtherError msg) --- | A type variable specification with optional class constraints-data TypeVar = TypeVar {- typeVarName :: String,- typeVarClasses :: [Name]-}- pair :: TermCoder x -> TermCoder y -> TermCoder (x, y) pair xCoder yCoder = TermCoder (Types.pair (termCoderType xCoder) (termCoderType yCoder)) encode decode where@@ -313,50 +285,41 @@ yTerm <- termCoderDecode yCoder cx y return $ Terms.pair xTerm yTerm -prim0 :: ToPrimName n => n -> x -> [TypeVar] -> TermCoder x -> Primitive-prim0 n value vars output = Primitive (defaultPrimitiveDefinition name typ) impl+-- The prim0..prim3 registration helpers take the primitive's authoritative, translingual+-- 'PrimitiveDefinition' (from the generated Hydra.Lib.* modules, e.g. @DefMath.add@) and use its+-- signature verbatim as the single source of truth for the primitive's type — including class+-- constraints, parameter laziness, and metadata. The 'TermCoder' arguments now serve ONLY the+-- runtime marshalling of the implementation (term<->native encode/decode); their 'termCoderType'+-- no longer contributes to the primitive's declared type. This removes the former divergence risk+-- between the hand-written registration type and the generated definition (#566).++prim0 :: PrimitiveDefinition -> x -> TermCoder x -> Primitive+prim0 def value output = Primitive def impl where- name = toPrimName n- typ = buildTypeScheme vars $ termCoderType output impl _g _args = termCoderDecode output primCx value -prim1 :: ToPrimName n => n -> (x -> y) -> [TypeVar] -> TermCoder x -> TermCoder y -> Primitive-prim1 n compute vars input1 output = Primitive (defaultPrimitiveDefinition name typ) impl+prim1 :: PrimitiveDefinition -> (x -> y) -> TermCoder x -> TermCoder y -> Primitive+prim1 def compute input1 output = Primitive def impl where- name = toPrimName n- typ = buildTypeScheme vars $ Types.functionMany [- termCoderType input1,- termCoderType output] impl g args = do- ExtractCore.nArgs name 1 args+ ExtractCore.nArgs (primitiveDefinitionName def) 1 args arg1 <- termCoderEncode input1 primCx g (args !! 0) termCoderDecode output primCx $ compute arg1 -prim2 :: ToPrimName n => n -> (x -> y -> z) -> [TypeVar] -> TermCoder x -> TermCoder y -> TermCoder z -> Primitive-prim2 n compute vars input1 input2 output = Primitive (defaultPrimitiveDefinition name typ) impl+prim2 :: PrimitiveDefinition -> (x -> y -> z) -> TermCoder x -> TermCoder y -> TermCoder z -> Primitive+prim2 def compute input1 input2 output = Primitive def impl where- name = toPrimName n- typ = buildTypeScheme vars $ Types.functionMany [- termCoderType input1,- termCoderType input2,- termCoderType output] impl g args = do- ExtractCore.nArgs name 2 args+ ExtractCore.nArgs (primitiveDefinitionName def) 2 args arg1 <- termCoderEncode input1 primCx g (args !! 0) arg2 <- termCoderEncode input2 primCx g (args !! 1) termCoderDecode output primCx $ compute arg1 arg2 -prim3 :: ToPrimName n => n -> (w -> x -> y -> z) -> [TypeVar] -> TermCoder w -> TermCoder x -> TermCoder y -> TermCoder z -> Primitive-prim3 n compute vars input1 input2 input3 output = Primitive (defaultPrimitiveDefinition name typ) impl+prim3 :: PrimitiveDefinition -> (w -> x -> y -> z) -> TermCoder w -> TermCoder x -> TermCoder y -> TermCoder z -> Primitive+prim3 def compute input1 input2 input3 output = Primitive def impl where- name = toPrimName n- typ = buildTypeScheme vars $ Types.functionMany [- termCoderType input1,- termCoderType input2,- termCoderType input3,- termCoderType output] impl g args = do- ExtractCore.nArgs name 3 args+ ExtractCore.nArgs (primitiveDefinitionName def) 3 args arg1 <- termCoderEncode input1 primCx g (args !! 0) arg2 <- termCoderEncode input2 primCx g (args !! 1) arg3 <- termCoderEncode input3 primCx g (args !! 2)@@ -380,15 +343,6 @@ encode _cx _g = Right decode _cx = Right --- | Get just the variable names from a list of TypeVars-typeVarNames :: [TypeVar] -> [String]-typeVarNames = fmap typeVarName---- | Convert a list of TypeVars to the format needed by polyConstrained--- Filters out variables with no constraints-typeVarsToConstraints :: [TypeVar] -> [(String, [Name])]-typeVarsToConstraints = filter (not . L.null . snd) . fmap (\tv -> (typeVarName tv, typeVarClasses tv))- type_ :: TermCoder Type type_ = TermCoder (TypeVariable _Type) encode decode where@@ -420,18 +374,6 @@ where encode _cx g = ExtractCore.uint8 g decode _cx = Right . Terms.uint8---- | Create an unconstrained type variable-v :: String -> TypeVar-v name = TypeVar name []---- | Create a type variable with Eq constraint-vEq :: String -> TypeVar-vEq name = TypeVar name [Name "equality"]---- | Create a type variable with Ord constraint-vOrd :: String -> TypeVar-vOrd name = TypeVar name [Name "ordering"] variable :: String -> TermCoder Term variable v = TermCoder (Types.var v) encode decode
src/main/haskell/Hydra/Overlay/Haskell/Dsl/Typed/Phantoms.hs view
@@ -57,7 +57,7 @@ fun @@ arg = apply (asTerm fun) (asTerm arg) (++) :: (AsTerm f String, AsTerm g String) => f -> g -> TypedTerm String-f ++ g = primitive2 (Prims.primName DefStrings.cat2) (asTerm f) (asTerm g)+f ++ g = primitive2 (Prims.primName DefStrings.concat2) (asTerm f) (asTerm g) -- | Field definition operator for records: name>: value -- Example: "name">: string "John"
src/main/haskell/Hydra/Overlay/Haskell/Dsl/Typed/Testing.hs view
@@ -154,7 +154,7 @@ (testCaseUniversal $ universalTestCase (retype $ Eithers.either (Phantoms.lambda "e" (Phantoms.string "FAIL"))- (Phantoms.lambda "result" (Strings.cat2 (Phantoms.string "unexpected: ")+ (Phantoms.lambda "result" (Strings.concat2 (Phantoms.string "unexpected: ") (showTypeSchemeRef @@ Pairs.second (Pairs.first (Phantoms.var "result"))))) (inferTypeOfRef @@ testContextRef @@ testGraphRef @@ term)) (Phantoms.string "FAIL"))@@ -168,7 +168,7 @@ infTest name tags term ts = testCaseWithMetadata (Phantoms.string name) (testCaseUniversal $ universalTestCase (retype $ Eithers.either- (Phantoms.lambda "e" (Strings.cat2 (Phantoms.string "INFERENCE ERROR: ") (Phantoms.string "failed")))+ (Phantoms.lambda "e" (Strings.concat2 (Phantoms.string "INFERENCE ERROR: ") (Phantoms.string "failed"))) (Phantoms.lambda "result" (showTypeSchemeRef @@ Pairs.second (Pairs.first (Phantoms.var "result")))) (inferTypeOfRef @@ testContextRef @@ testGraphRef @@ term))@@ -344,14 +344,14 @@ -- for module-level findings. showValidationResultModule :: TypedTerm (ValidationResult InvalidModuleError) -> TypedTerm String showValidationResultModule vr = retype $- Strings.cat2- (Strings.cat2 (Phantoms.string "errors=[") $- Strings.cat2 (Strings.intercalate (Phantoms.string ";") $+ Strings.concat2+ (Strings.concat2 (Phantoms.string "errors=[") $+ Strings.concat2 (Strings.join (Phantoms.string ";") $ Lists.map (Phantoms.lambda "e" $ showInvalidModuleErrorRef @@ Phantoms.var "e") (Validation.validationResultErrors vr)) (Phantoms.string "]"))- (Strings.cat2 (Phantoms.string " warnings=[") $- Strings.cat2 (Strings.intercalate (Phantoms.string ";") $+ (Strings.concat2 (Phantoms.string " warnings=[") $+ Strings.concat2 (Strings.join (Phantoms.string ";") $ Lists.map (Phantoms.lambda "w" $ showInvalidModuleErrorRef @@ Phantoms.var "w") (Validation.validationResultWarnings vr)) (Phantoms.string "]"))@@ -363,14 +363,14 @@ -- counterpart of 'showValidationResultTerm'. showValidationResultPackage :: TypedTerm (ValidationResult InvalidPackageError) -> TypedTerm String showValidationResultPackage vr = retype $- Strings.cat2- (Strings.cat2 (Phantoms.string "errors=[") $- Strings.cat2 (Strings.intercalate (Phantoms.string ";") $+ Strings.concat2+ (Strings.concat2 (Phantoms.string "errors=[") $+ Strings.concat2 (Strings.join (Phantoms.string ";") $ Lists.map (Phantoms.lambda "e" $ showInvalidPackageErrorRef @@ Phantoms.var "e") (Validation.validationResultErrors vr)) (Phantoms.string "]"))- (Strings.cat2 (Phantoms.string " warnings=[") $- Strings.cat2 (Strings.intercalate (Phantoms.string ";") $+ (Strings.concat2 (Phantoms.string " warnings=[") $+ Strings.concat2 (Strings.join (Phantoms.string ";") $ Lists.map (Phantoms.lambda "w" $ showInvalidPackageErrorRef @@ Phantoms.var "w") (Validation.validationResultWarnings vr)) (Phantoms.string "]"))@@ -420,14 +420,14 @@ -- 'ValidationResult' values in profile-aware test cases. showValidationResultTerm :: TypedTerm (ValidationResult InvalidTermError) -> TypedTerm String showValidationResultTerm vr = retype $- Strings.cat2- (Strings.cat2 (Phantoms.string "errors=[") $- Strings.cat2 (Strings.intercalate (Phantoms.string ";") $+ Strings.concat2+ (Strings.concat2 (Phantoms.string "errors=[") $+ Strings.concat2 (Strings.join (Phantoms.string ";") $ Lists.map (Phantoms.lambda "e" $ showInvalidTermErrorRef @@ Phantoms.var "e") (Validation.validationResultErrors vr)) (Phantoms.string "]"))- (Strings.cat2 (Phantoms.string " warnings=[") $- Strings.cat2 (Strings.intercalate (Phantoms.string ";") $+ (Strings.concat2 (Phantoms.string " warnings=[") $+ Strings.concat2 (Strings.join (Phantoms.string ";") $ Lists.map (Phantoms.lambda "w" $ showInvalidTermErrorRef @@ Phantoms.var "w") (Validation.validationResultWarnings vr)) (Phantoms.string "]"))@@ -530,7 +530,7 @@ validateCoreTermCase :: String -> TypedTerm Bool -> TypedTerm Term -> TypedTerm (Maybe InvalidTermError) -> TypedTerm TestCaseWithMetadata validateCoreTermCase cname typed input expected = universalCase cname (retype $ Optionals.cases- (Lists.maybeHead $ Validation.validationResultErrors $+ (Lists.head $ Validation.validationResultErrors $ validateCoreTermProfiledRef @@ kernelDefaultCoreProfileRef @@ typed @@ testGraphRef @@ input) (Phantoms.string "valid") (Phantoms.lambda "e" (showInvalidTermErrorRef @@ Phantoms.var "e")))
src/main/haskell/Hydra/Overlay/Haskell/Lib/Eithers.hs view
@@ -29,22 +29,10 @@ either :: (a -> c) -> (b -> c) -> Either a b -> c either = E.either --- | Left-fold over a list with an Either-returning function, short-circuiting on Left. (Alias of foldl.)+-- | Left-fold over a list with an Either-returning function, short-circuiting on Left. foldList :: (a -> b -> Either c a) -> a -> [b] -> Either c a foldList = CM.foldM --- | Left-fold over a list with an Either-returning function, short-circuiting on Left.-foldl :: (a -> b -> Either c a) -> a -> [b] -> Either c a-foldl = CM.foldM---- | Extract the Left value, or return a default.-fromLeft :: a -> Either a b -> a-fromLeft = E.fromLeft---- | Extract the Right value, or return a default.-fromRight :: b -> Either a b -> b-fromRight = E.fromRight- -- | Check if an Either is a Left value. isLeft :: Either a b -> Bool isLeft = E.isLeft@@ -73,13 +61,9 @@ mapSet :: Ord b => (a -> Either c b) -> S.Set a -> Either c (S.Set b) mapSet f s = fmap S.fromList (CM.mapM f (S.toList s)) --- | Partition a list of Eithers into lefts and rights. (Alias of partitionEithers.)+-- | Partition a list of Eithers into lefts and rights. partition :: [Either a b] -> ([a], [b]) partition = E.partitionEithers---- | Partition a list of Eithers into lefts and rights.-partitionEithers :: [Either a b] -> ([a], [b])-partitionEithers = E.partitionEithers -- | Wrap a value as a Right. pure :: b -> Either a b
src/main/haskell/Hydra/Overlay/Haskell/Lib/Equality.hs view
@@ -2,49 +2,10 @@ module Hydra.Overlay.Haskell.Lib.Equality where -import Hydra.Util -import Data.Int----- | Compare two values and return a Comparison.-compare :: Ord a => a -> a -> Comparison-compare x y- | x < y = ComparisonLessThan- | x > y = ComparisonGreaterThan- | otherwise = ComparisonEqualTo- -- | Check if two values are equal. equal :: Eq a => a -> a -> Bool equal = (==)---- | Check if first value is greater than second.-gt :: Ord a => a -> a -> Bool-gt = (>)---- | Check if first value is greater than or equal to second.-gte :: Ord a => a -> a -> Bool-gte = (>=)---- | Return a value unchanged.-identity :: a -> a-identity = id---- | Check if first value is less than second.-lt :: Ord a => a -> a -> Bool-lt = (<)---- | Check if first value is less than or equal to second.-lte :: Ord a => a -> a -> Bool-lte = (<=)---- | Return the maximum of two values.-max :: Ord a => a -> a -> a-max = Prelude.max---- | Return the minimum of two values.-min :: Ord a => a -> a -> a-min = Prelude.min -- | Check if two values are unequal. notEqual :: Eq a => a -> a -> Bool
src/main/haskell/Hydra/Overlay/Haskell/Lib/Lists.hs view
@@ -55,10 +55,6 @@ dropWhile :: (a -> Bool) -> [a] -> [a] dropWhile = L.dropWhile --- | Check if an element is in a list.-elem :: Eq a => a -> [a] -> Bool-elem = L.elem- -- | Filter a list based on a predicate. filter :: (a -> Bool) -> [a] -> [a] filter = L.filter@@ -98,10 +94,6 @@ init [] = Nothing init xs = Just (L.init xs) --- | Intercalate a list of lists with a separator list between each.-intercalate :: [a] -> [[a]] -> [a]-intercalate = L.intercalate- -- | Intercalate a list of lists with a separator list between each. (Alias of intercalate.) join :: [a] -> [[a]] -> [a] join = L.intercalate@@ -139,36 +131,6 @@ member :: Eq a => a -> [a] -> Bool member = L.elem --- | Get the element at a specified index in a list, returning Nothing if out of bounds.-maybeAt :: Int -> [a] -> Maybe a-maybeAt i l- | i < 0 || i >= L.length l = Nothing- | otherwise = Just (l !! i)---- | Get the first element of a list, returning Nothing if the list is empty.-maybeHead :: [a] -> Maybe a-maybeHead [] = Nothing-maybeHead (x:_) = Just x---- | Return all elements except the last one, returning Nothing if the list is empty.-maybeInit :: [a] -> Maybe [a]-maybeInit [] = Nothing-maybeInit xs = Just (L.init xs)---- | Get the last element of a list, returning Nothing if the list is empty.-maybeLast :: [a] -> Maybe a-maybeLast [] = Nothing-maybeLast xs = Just (L.last xs)---- | Get all elements of a list except the first, returning Nothing if the list is empty.-maybeTail :: [a] -> Maybe [a]-maybeTail [] = Nothing-maybeTail (_:xs) = Just xs---- | Remove duplicate elements from a list.-nub :: Eq a => [a] -> [a]-nub = L.nub- -- | Check if a list is empty. null :: [a] -> Bool null = L.null@@ -200,10 +162,6 @@ -- | Sort a list based on a key function. (Alias of sortOn.) sortBy :: Ord b => (a -> b) -> [a] -> [a] sortBy = L.sortOn---- | Sort a list based on a key function.-sortOn :: Ord b => (a -> b) -> [a] -> [a]-sortOn = L.sortOn -- | Split a list at the first element where predicate fails. span :: (a -> Bool) -> [a] -> ([a], [a])
src/main/haskell/Hydra/Overlay/Haskell/Lib/Literals.hs view
@@ -66,8 +66,8 @@ decimalToFloat64 = toRealFloat -- | Convert binary to string by base64 encoding.-binaryToString :: B.ByteString -> String-binaryToString = T.unpack . TE.decodeUtf8 . B64.encode+binaryToBase64 :: B.ByteString -> String+binaryToBase64 = T.unpack . TE.decodeUtf8 . B64.encode -- | Convert a float32 (Float) to a decimal (Scientific). float32ToDecimal :: Float -> Scientific@@ -116,8 +116,8 @@ readBigint s = readMaybe s :: Maybe Integer -- | Parse a string to a boolean.-readBoolean :: String -> Maybe Bool-readBoolean s = if s == "true" then Just True+parseBoolean :: String -> Maybe Bool+parseBoolean s = if s == "true" then Just True else if s == "false" then Just False else Nothing @@ -154,8 +154,8 @@ readInt64 s = readMaybe s :: Maybe Int64 -- | Parse a string literal.-readString :: String -> Maybe String-readString s = readMaybe s :: Maybe String+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@@ -190,8 +190,8 @@ showBigint = show -- | Convert a boolean to string.-showBoolean :: Bool -> String-showBoolean b = case b of+printBoolean :: Bool -> String+printBoolean b = case b of True -> "true" False -> "false" @@ -226,8 +226,8 @@ showInt64 = show -- | Convert a string to a quoted string representation.-showString :: String -> String-showString = show+printString :: String -> String+printString = show -- | Convert a uint8 to string. showUint8 :: Int16 -> String@@ -247,8 +247,8 @@ -- | Convert string to binary by base64 decoding. -- Returns an empty ByteString if decoding fails.-stringToBinary :: String -> B.ByteString-stringToBinary s = case B64.decode (TE.encodeUtf8 $ T.pack s) of+base64ToBinary :: String -> B.ByteString+base64ToBinary s = case B64.decode (TE.encodeUtf8 $ T.pack s) of Left _ -> B.empty Right bs -> bs
src/main/haskell/Hydra/Overlay/Haskell/Lib/Math.hs view
@@ -1,9 +1,11 @@ -- | Haskell implementations of hydra.lib.math primitives+{-# LANGUAGE RankNTypes #-} module Hydra.Overlay.Haskell.Lib.Math where -import Prelude (Num, Ord, Integral, Enum, Bool, Double, Int, Integer, Float, Maybe(..), (.), ($), (+), (-), (*), (==), (||))+import Prelude (Num, Ord, Integral, Enum, Bool, Double, Int, Integer, Float, Maybe(..), String, (.), ($), (+), (-), (*), (==), (||)) import qualified Prelude+import qualified Hydra.Core as Core -- | Return the absolute value.@@ -96,23 +98,15 @@ logBase :: Double -> Double -> Double logBase = Prelude.logBase --- | Return the maximum of two values.-max :: Ord a => a -> a -> a-max = Prelude.max- -- | Divide two integers using integer division, returning Nothing on division by zero.-maybeDiv :: Int -> Int -> Maybe Int-maybeDiv _ 0 = Nothing-maybeDiv x y = Just (Prelude.div x y)---- | Return the minimum of two values.-min :: Ord a => a -> a -> a-min = Prelude.min+div :: Int -> Int -> Maybe Int+div _ 0 = Nothing+div x y = Just (Prelude.div x y) -- | Mathematical modulo, returning Nothing on division by zero.-maybeMod :: Int -> Int -> Maybe Int-maybeMod _ 0 = Nothing-maybeMod x y = Just (Prelude.mod x y)+mod :: Int -> Int -> Maybe Int+mod _ 0 = Nothing+mod x y = Just (Prelude.mod x y) -- | Multiply two numbers. mul :: Num a => a -> a -> a@@ -142,20 +136,14 @@ pow :: Double -> Double -> Double pow = (Prelude.**) --- | Return the predecessor (x - 1), returning Nothing on int32 minBound.-maybePred :: Int -> Maybe Int-maybePred x- | x == (-2147483648) = Nothing- | Prelude.otherwise = Just (x - 1)- -- | Generate a range of values from start to end (inclusive). range :: Enum a => a -> a -> [a] range start end = [start .. end] -- | Integer remainder, returning Nothing on division by zero.-maybeRem :: Int -> Int -> Maybe Int-maybeRem _ 0 = Nothing-maybeRem x y = Just (Prelude.rem x y)+rem :: Int -> Int -> Maybe Int+rem _ 0 = Nothing+rem x y = Just (Prelude.rem x y) -- | Return x rounded to the nearest integer, as a float. --@@ -210,11 +198,6 @@ subFloat64 :: Double -> Double -> Double subFloat64 = sub --- | Return the successor (x + 1), returning Nothing on int32 maxBound.-maybeSucc :: Int -> Maybe Int-maybeSucc x- | x == 2147483647 = Nothing- | Prelude.otherwise = Just (x + 1) -- | Return the tangent of x radians. tan :: Double -> Double@@ -232,3 +215,91 @@ truncate x | Prelude.isNaN x Prelude.|| Prelude.isInfinite x = x | Prelude.otherwise = Prelude.fromIntegral (Prelude.truncate x :: Integer)++-- Constraint-polymorphic ('numeric') arithmetic over raw terms.+--+-- These implementations back the polymorphic add/sub/mul/negate primitives, which are+-- registered with identity (Term) coders (see Hydra.Overlay.Haskell.Libraries) so that the+-- runtime numeric type is discovered by dispatching on the argument's literal variant. Each+-- variant delegates to Haskell's Num instance for the underlying representation type, which+-- gives the correct per-type semantics for free: two's-complement wraparound for the+-- fixed-width integer types, arbitrary precision for bigint, and IEEE 754 for the floats.+--+-- Type inference guarantees both operands of a binary op share one 'numeric' type, so the+-- dispatch keys on the first operand and requires the second to match; a mismatch or a+-- non-numeric literal is an internal invariant violation and fails loudly.++-- | Apply a Num-polymorphic binary operation to two numeric terms, dispatching on the runtime+-- integer/float variant.+numericBinary :: String -> (forall a. Num a => a -> a -> a) -> Core.Term -> Core.Term -> Core.Term+numericBinary opName op x y = case (numericLiteral opName x, numericLiteral opName y) of+ (Core.LiteralInteger ix, Core.LiteralInteger iy) ->+ Core.TermLiteral $ Core.LiteralInteger $ integerBinary opName op ix iy+ (Core.LiteralFloat fx, Core.LiteralFloat fy) ->+ Core.TermLiteral $ Core.LiteralFloat $ floatBinary opName op fx fy+ _ -> Prelude.error $ "hydra.lib.math." Prelude.++ opName Prelude.++ ": operands are not the same numeric kind"++-- | Apply a Num-polymorphic unary operation to a numeric term.+numericUnary :: String -> (forall a. Num a => a -> a) -> Core.Term -> Core.Term+numericUnary opName op x = case numericLiteral opName x of+ Core.LiteralInteger ix -> Core.TermLiteral $ Core.LiteralInteger $ integerUnary op ix+ Core.LiteralFloat fx -> Core.TermLiteral $ Core.LiteralFloat $ floatUnary op fx+ _ -> Prelude.error $ "hydra.lib.math." Prelude.++ opName Prelude.++ ": operand is not numeric"++-- | Extract the literal from a term, failing loudly on any non-literal term.+numericLiteral :: String -> Core.Term -> Core.Literal+numericLiteral opName term = case term of+ Core.TermLiteral lit -> lit+ _ -> Prelude.error $ "hydra.lib.math." Prelude.++ opName Prelude.++ ": expected a literal term"++integerBinary :: String -> (forall a. Num a => a -> a -> a) -> Core.IntegerValue -> Core.IntegerValue -> Core.IntegerValue+integerBinary opName op ix iy = case (ix, iy) of+ (Core.IntegerValueBigint a, Core.IntegerValueBigint b) -> Core.IntegerValueBigint (op a b)+ (Core.IntegerValueInt8 a, Core.IntegerValueInt8 b) -> Core.IntegerValueInt8 (op a b)+ (Core.IntegerValueInt16 a, Core.IntegerValueInt16 b) -> Core.IntegerValueInt16 (op a b)+ (Core.IntegerValueInt32 a, Core.IntegerValueInt32 b) -> Core.IntegerValueInt32 (op a b)+ (Core.IntegerValueInt64 a, Core.IntegerValueInt64 b) -> Core.IntegerValueInt64 (op a b)+ (Core.IntegerValueUint8 a, Core.IntegerValueUint8 b) -> Core.IntegerValueUint8 (op a b)+ (Core.IntegerValueUint16 a, Core.IntegerValueUint16 b) -> Core.IntegerValueUint16 (op a b)+ (Core.IntegerValueUint32 a, Core.IntegerValueUint32 b) -> Core.IntegerValueUint32 (op a b)+ (Core.IntegerValueUint64 a, Core.IntegerValueUint64 b) -> Core.IntegerValueUint64 (op a b)+ _ -> Prelude.error $ "hydra.lib.math." Prelude.++ opName Prelude.++ ": integer operands differ in precision"++integerUnary :: (forall a. Num a => a -> a) -> Core.IntegerValue -> Core.IntegerValue+integerUnary op iv = case iv of+ Core.IntegerValueBigint a -> Core.IntegerValueBigint (op a)+ Core.IntegerValueInt8 a -> Core.IntegerValueInt8 (op a)+ Core.IntegerValueInt16 a -> Core.IntegerValueInt16 (op a)+ Core.IntegerValueInt32 a -> Core.IntegerValueInt32 (op a)+ Core.IntegerValueInt64 a -> Core.IntegerValueInt64 (op a)+ Core.IntegerValueUint8 a -> Core.IntegerValueUint8 (op a)+ Core.IntegerValueUint16 a -> Core.IntegerValueUint16 (op a)+ Core.IntegerValueUint32 a -> Core.IntegerValueUint32 (op a)+ Core.IntegerValueUint64 a -> Core.IntegerValueUint64 (op a)++floatBinary :: String -> (forall a. Num a => a -> a -> a) -> Core.FloatValue -> Core.FloatValue -> Core.FloatValue+floatBinary opName op fx fy = case (fx, fy) of+ (Core.FloatValueFloat32 a, Core.FloatValueFloat32 b) -> Core.FloatValueFloat32 (op a b)+ (Core.FloatValueFloat64 a, Core.FloatValueFloat64 b) -> Core.FloatValueFloat64 (op a b)+ _ -> Prelude.error $ "hydra.lib.math." Prelude.++ opName Prelude.++ ": float operands differ in precision"++floatUnary :: (forall a. Num a => a -> a) -> Core.FloatValue -> Core.FloatValue+floatUnary op fv = case fv of+ Core.FloatValueFloat32 a -> Core.FloatValueFloat32 (op a)+ Core.FloatValueFloat64 a -> Core.FloatValueFloat64 (op a)++-- | Polymorphic addition over numeric terms.+addTerm :: Core.Term -> Core.Term -> Core.Term+addTerm = numericBinary "add" (+)++-- | Polymorphic subtraction over numeric terms.+subTerm :: Core.Term -> Core.Term -> Core.Term+subTerm = numericBinary "sub" (-)++-- | Polymorphic multiplication over numeric terms.+mulTerm :: Core.Term -> Core.Term -> Core.Term+mulTerm = numericBinary "mul" (*)++-- | Polymorphic negation over numeric terms.+negateTerm :: Core.Term -> Core.Term+negateTerm = numericUnary "negate" Prelude.negate
src/main/haskell/Hydra/Overlay/Haskell/Lib/Optionals.hs view
@@ -20,10 +20,6 @@ cases :: Y.Maybe a -> b -> (a -> b) -> b cases m n j = Y.maybe n j m --- | Filter out absent values from a list.-cat :: [Y.Maybe a] -> [a]-cat = Y.catMaybes- -- | Compose two optional-returning functions (Kleisli composition). compose :: (a -> Y.Maybe b) -> (b -> Y.Maybe c) -> (a -> Y.Maybe c) compose f g = \x -> f x >>= g@@ -32,11 +28,7 @@ foldList :: (a -> b -> Y.Maybe a) -> a -> [b] -> Y.Maybe a foldList = CM.foldM --- | Get a value from an optional value, or return a default value.-fromOptional :: a -> Y.Maybe a -> a-fromOptional = Y.fromMaybe---- | Filter out absent values from a list. (Alias of cat.)+-- | Filter out absent values from a list. givens :: [Y.Maybe a] -> [a] givens = Y.catMaybes @@ -72,6 +64,6 @@ toList :: Y.Maybe a -> [a] toList = Y.maybeToList --- | Get a value from an optional value, or return a default value. (Alias of fromOptional.)+-- | Get a value from an optional value, or return a default value. withDefault :: a -> Y.Maybe a -> a withDefault = Y.fromMaybe
+ src/main/haskell/Hydra/Overlay/Haskell/Lib/Ordering.hs view
@@ -0,0 +1,37 @@+-- | Haskell implementations of hydra.lib.ordering primitives.++module Hydra.Overlay.Haskell.Lib.Ordering where++import Hydra.Util+++-- | Compare two values and return a Comparison.+compare :: Ord a => a -> a -> Comparison+compare x y+ | x < y = ComparisonLessThan+ | x > y = ComparisonGreaterThan+ | otherwise = ComparisonEqualTo++-- | Check if first value is greater than second.+gt :: Ord a => a -> a -> Bool+gt = (>)++-- | Check if first value is greater than or equal to second.+gte :: Ord a => a -> a -> Bool+gte = (>=)++-- | Check if first value is less than second.+lt :: Ord a => a -> a -> Bool+lt = (<)++-- | Check if first value is less than or equal to second.+lte :: Ord a => a -> a -> Bool+lte = (<=)++-- | Return the maximum of two values.+max :: Ord a => a -> a -> a+max = Prelude.max++-- | Return the minimum of two values.+min :: Ord a => a -> a -> a+min = Prelude.min
src/main/haskell/Hydra/Overlay/Haskell/Lib/Strings.hs view
@@ -8,25 +8,17 @@ import qualified Data.List.Split as LS --- | Concatenate a list of strings into a single string.-cat :: [String] -> String-cat = L.concat---- | Concatenate two strings.-cat2 :: String -> String -> String-cat2 s1 s2 = s1 ++ s2---- | Get the Unicode code point of the character at a specific index. (Alias of maybeCharAt.)+-- | Get the Unicode code point of the character at a specific index, returning Nothing if out of bounds. charAt :: Int -> String -> Maybe Int charAt i s | i < 0 || i >= L.length s = Nothing | otherwise = Just (C.ord (s !! i)) --- | Concatenate a list of strings into a single string. (Alias of cat.)+-- | Concatenate a list of strings into a single string. concat :: [String] -> String concat = L.concat --- | Concatenate two strings. (Alias of cat2.)+-- | Concatenate two strings. concat2 :: String -> String -> String concat2 s1 s2 = s1 ++ s2 @@ -35,22 +27,12 @@ fromList = fmap C.chr -- | Join a list of strings with a separator between each element.-intercalate :: String -> [String] -> String-intercalate = L.intercalate---- | Join a list of strings with a separator between each element. (Alias of intercalate.) join :: String -> [String] -> String join = L.intercalate -- | Return the length of a string. length :: String -> Int length = L.length---- | Get the Unicode code point of the character at a specific index, returning Nothing if out of bounds.-maybeCharAt :: Int -> String -> Maybe Int-maybeCharAt i s- | i < 0 || i >= L.length s = Nothing- | otherwise = Just (C.ord (s !! i)) -- | Split a string into lines. lines :: String -> [String]
src/main/haskell/Hydra/Overlay/Haskell/Libraries.hs view
@@ -20,6 +20,7 @@ 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+import qualified Hydra.Overlay.Haskell.Lib.Ordering as Ordering import qualified Hydra.Overlay.Haskell.Lib.Pairs as Pairs import qualified Hydra.Overlay.Haskell.Lib.Regex as Regex import qualified Hydra.Overlay.Haskell.Lib.Sets as Sets@@ -38,6 +39,7 @@ import qualified Hydra.Lib.Maps as DefMaps import qualified Hydra.Lib.Math as DefMath import qualified Hydra.Lib.Optionals as DefOptionals+import qualified Hydra.Lib.Ordering as DefOrdering import qualified Hydra.Lib.Pairs as DefPairs import qualified Hydra.Lib.Regex as DefRegex import qualified Hydra.Lib.Sets as DefSets@@ -48,37 +50,6 @@ import qualified Data.List as L --- Type variables (TypeVar) for primitive type schemes--- Unconstrained-_a, _b, _c, _d, _k, _k1, _k2, _s, _v, _v1, _v2, _w, _x, _y, _z :: TypeVar-_a = v "a"-_b = v "b"-_c = v "c"-_d = v "d"-_k = v "k"-_k1 = v "k1"-_k2 = v "k2"-_s = v "s"-_v = v "v"-_v1 = v "v1"-_v2 = v "v2"-_w = v "w"-_x = v "x"-_y = v "y"-_z = v "z"---- Ord-constrained-_kOrd, _k1Ord, _k2Ord, _xOrd, _yOrd :: TypeVar-_kOrd = vOrd "k"-_k1Ord = vOrd "k1"-_k2Ord = vOrd "k2"-_xOrd = vOrd "x"-_yOrd = vOrd "y"---- Eq-constrained-_xEq :: TypeVar-_xEq = vEq "x"- -- Term coders for type variables (used in primitive implementations) a_, b_, c_, d_, k_, k1_, k2_, s_, v_, v1_, v2_, w_, x_, y_, z_ :: TermCoder Term a_ = variable "a"@@ -116,14 +87,14 @@ hydraLibChars :: Library hydraLibChars = standardLibrary [- prim1 DefChars.isAlpha Chars.isAlpha [] int32 boolean,- prim1 DefChars.isAlphaNum Chars.isAlphaNum [] int32 boolean,- prim1 DefChars.isDigit Chars.isDigit [] int32 boolean,- prim1 DefChars.isLower Chars.isLower [] int32 boolean,- prim1 DefChars.isSpace Chars.isSpace [] int32 boolean,- prim1 DefChars.isUpper Chars.isUpper [] int32 boolean,- prim1 DefChars.toLower Chars.toLower [] int32 int32,- prim1 DefChars.toUpper Chars.toUpper [] int32 int32]+ prim1 DefChars.isAlpha Chars.isAlpha int32 boolean,+ prim1 DefChars.isAlphaNum Chars.isAlphaNum int32 boolean,+ prim1 DefChars.isDigit Chars.isDigit int32 boolean,+ prim1 DefChars.isLower Chars.isLower int32 boolean,+ prim1 DefChars.isSpace Chars.isSpace int32 boolean,+ prim1 DefChars.isUpper Chars.isUpper int32 boolean,+ prim1 DefChars.toLower Chars.toLower int32 int32,+ prim1 DefChars.toUpper Chars.toUpper int32 int32] hydraLibEffects :: Library hydraLibEffects = standardLibrary [@@ -131,7 +102,6 @@ unsupportedEffectPrimitive DefEffects.bind, unsupportedEffectPrimitive DefEffects.compose, unsupportedEffectPrimitive DefEffects.foldList,- unsupportedEffectPrimitive DefEffects.foldl, unsupportedEffectPrimitive DefEffects.map, unsupportedEffectPrimitive DefEffects.mapList, unsupportedEffectPrimitive DefEffects.mapOptional,@@ -154,319 +124,315 @@ hydraLibEithers :: Library hydraLibEithers = standardLibrary [- prim2 DefEithers.apply Eithers.apply [_x, _y, _z] (Prims.either_ x_ (funT y_ z_)) (Prims.either_ x_ y_) (Prims.either_ x_ z_),- prim3 DefEithers.bimap Eithers.bimap [_x, _y, _z, _w] (funT x_ z_) (funT y_ w_) (Prims.either_ x_ y_) (Prims.either_ z_ w_),- prim2 DefEithers.bind Eithers.bind [_x, _y, _z] (Prims.either_ x_ y_) (fun y_ (Prims.either_ x_ z_)) (Prims.either_ x_ z_),- prim3 DefEithers.compose Eithers.compose [_x, _y, _z, _w] (fun x_ (Prims.either_ w_ y_)) (fun y_ (Prims.either_ w_ z_)) x_ (Prims.either_ w_ z_),- prim3 DefEithers.either Eithers.either [_x, _y, _z] (funT x_ z_) (funT y_ z_) (Prims.either_ x_ y_) z_,- prim3 DefEithers.foldList Eithers.foldList [_x, _y, _z] (fun x_ (fun y_ (Prims.either_ z_ x_))) x_ (list y_) (Prims.either_ z_ x_),- prim3 DefEithers.foldl Eithers.foldl [_x, _y, _z] (fun x_ (fun y_ (Prims.either_ z_ x_))) x_ (list y_) (Prims.either_ z_ x_),- Prims.lazyArgs [0] $ prim2 DefEithers.fromLeft Eithers.fromLeft [_x, _y] x_ (Prims.either_ x_ y_) x_,- Prims.lazyArgs [0] $ prim2 DefEithers.fromRight Eithers.fromRight [_x, _y] y_ (Prims.either_ x_ y_) y_,- prim1 DefEithers.isLeft Eithers.isLeft [_x, _y] (Prims.either_ x_ y_) boolean,- prim1 DefEithers.isRight Eithers.isRight [_x, _y] (Prims.either_ x_ y_) boolean,- prim1 DefEithers.lefts Eithers.lefts [_x, _y] (list $ Prims.either_ x_ y_) (list x_),- prim2 DefEithers.map Eithers.map [_x, _y, _z] (funT x_ y_) (Prims.either_ z_ x_) (Prims.either_ z_ y_),- prim2 DefEithers.mapList Eithers.mapList [_x, _y, _z] (fun x_ (Prims.either_ z_ y_)) (list x_) (Prims.either_ z_ (list y_)),- prim2 DefEithers.mapOptional Eithers.mapOptional [_x, _y, _z] (fun x_ (Prims.either_ z_ y_)) (optional x_) (Prims.either_ z_ (optional y_)),- prim2 DefEithers.mapSet Eithers.mapSet [_x, _y, _z] (fun x_ (Prims.either_ z_ y_)) (set x_) (Prims.either_ z_ (set y_)),- prim1 DefEithers.partition Eithers.partition [_x, _y] (list $ Prims.either_ x_ y_) (pair (list x_) (list y_)),- prim1 DefEithers.partitionEithers Eithers.partitionEithers [_x, _y] (list $ Prims.either_ x_ y_) (pair (list x_) (list y_)),- prim1 DefEithers.pure Eithers.pure [_x, _y] y_ (Prims.either_ x_ y_),- prim1 DefEithers.rights Eithers.rights [_x, _y] (list $ Prims.either_ x_ y_) (list y_)]+ prim2 DefEithers.apply Eithers.apply (Prims.either_ x_ (funT y_ z_)) (Prims.either_ x_ y_) (Prims.either_ x_ z_),+ prim3 DefEithers.bimap Eithers.bimap (funT x_ z_) (funT y_ w_) (Prims.either_ x_ y_) (Prims.either_ z_ w_),+ prim2 DefEithers.bind Eithers.bind (Prims.either_ x_ y_) (fun y_ (Prims.either_ x_ z_)) (Prims.either_ x_ z_),+ prim3 DefEithers.compose Eithers.compose (fun x_ (Prims.either_ w_ y_)) (fun y_ (Prims.either_ w_ z_)) x_ (Prims.either_ w_ z_),+ prim3 DefEithers.either Eithers.either (funT x_ z_) (funT y_ z_) (Prims.either_ x_ y_) z_,+ prim3 DefEithers.foldList Eithers.foldList (fun x_ (fun y_ (Prims.either_ z_ x_))) x_ (list y_) (Prims.either_ z_ x_),+ 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.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_)),+ prim2 DefEithers.mapOptional Eithers.mapOptional (fun x_ (Prims.either_ z_ y_)) (optional x_) (Prims.either_ z_ (optional y_)),+ 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.rights Eithers.rights (list $ Prims.either_ x_ y_) (list y_)] hydraLibEquality :: Library hydraLibEquality = standardLibrary [- prim2 DefEquality.compare Equality.compare [_xOrd] x_ x_ comparison,- prim2 DefEquality.equal Equality.equal [_xEq] x_ x_ boolean,- prim2 DefEquality.gt Equality.gt [_xOrd] x_ x_ boolean,- prim2 DefEquality.gte Equality.gte [_xOrd] x_ x_ boolean,- prim1 DefEquality.identity Equality.identity [_x] x_ x_,- prim2 DefEquality.lt Equality.lt [_xOrd] x_ x_ boolean,- prim2 DefEquality.lte Equality.lte [_xOrd] x_ x_ boolean,- prim2 DefEquality.max Equality.max [_xOrd] x_ x_ x_,- prim2 DefEquality.min Equality.min [_xOrd] x_ x_ x_,- prim2 DefEquality.notEqual Equality.notEqual [_xEq] x_ x_ boolean]+ prim2 DefEquality.equal Equality.equal x_ x_ boolean,+ prim2 DefEquality.notEqual Equality.notEqual x_ x_ boolean] +hydraLibOrdering :: Library+hydraLibOrdering = standardLibrary [+ prim2 DefOrdering.compare Ordering.compare x_ x_ comparison,+ prim2 DefOrdering.gt Ordering.gt x_ x_ boolean,+ prim2 DefOrdering.gte Ordering.gte x_ x_ boolean,+ prim2 DefOrdering.lt Ordering.lt x_ x_ boolean,+ prim2 DefOrdering.lte Ordering.lte x_ x_ boolean,+ prim2 DefOrdering.max Ordering.max x_ x_ x_,+ prim2 DefOrdering.min Ordering.min x_ x_ x_]+ hydraLibFunctions :: Library hydraLibFunctions = standardLibrary [- prim3 DefFunctions.compose Functions.compose [_x, _y, _z] (funT y_ z_) (funT x_ y_) x_ z_,- prim2 DefFunctions.const Functions.const [_x, _y] x_ y_ x_,- prim3 DefFunctions.flip Functions.flip [_x, _y, _z] (funT x_ (funT y_ z_)) y_ x_ z_,- prim1 DefFunctions.identity Functions.identity [_x] x_ x_]+ 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_,+ prim1 DefFunctions.identity Functions.identity x_ x_] hydraLibLists :: Library hydraLibLists = standardLibrary [- prim2 DefLists.apply Lists.apply [_x, _y] (list $ funT x_ y_) (list x_) (list y_),- prim2 DefLists.at Lists.at [_x] int32 (list x_) (optional x_),- prim2 DefLists.bind Lists.bind [_x, _y] (list x_) (fun x_ (list y_)) (list y_),- prim3 DefLists.compose Lists.compose [_x, _y, _z] (fun x_ (list y_)) (fun y_ (list z_)) x_ (list z_),- prim1 DefLists.concat Lists.concat [_x] (list (list x_)) (list x_),- prim2 DefLists.concat2 Lists.concat2 [_x] (list x_) (list x_) (list x_),- prim2 DefLists.cons Lists.cons [_x] x_ (list x_) (list x_),- prim1 DefLists.distinct Lists.distinct [_xEq] (list x_) (list x_),- prim2 DefLists.drop Lists.drop [_x] int32 (list x_) (list x_),- prim2 DefLists.dropWhile Lists.dropWhile [_x] (fun x_ boolean) (list x_) (list x_),- prim2 DefLists.elem Lists.elem [_xEq] x_ (list x_) boolean,- prim2 DefLists.filter Lists.filter [_x] (fun x_ boolean) (list x_) (list x_),- prim2 DefLists.find Lists.find [_x] (fun x_ boolean) (list x_) (optional x_),- prim3 DefLists.foldList Lists.foldList [_x, _y] (fun x_ (fun y_ (list x_))) x_ (list y_) (list x_),- prim3 DefLists.foldl Lists.foldl [_y, _x] (funT y_ (funT x_ y_)) y_ (list x_) y_,- prim3 DefLists.foldr Lists.foldr [_x, _y] (funT x_ (funT y_ y_)) y_ (list x_) y_,- prim1 DefLists.group Lists.group [_xEq] (list x_) (list (list x_)),- prim1 DefLists.head Lists.head [_x] (list x_) (optional x_),- prim1 DefLists.init Lists.init [_x] (list x_) (optional (list x_)),- prim2 DefLists.intercalate Lists.intercalate [_x] (list x_) (list (list x_)) (list x_),- prim2 DefLists.join Lists.join [_x] (list x_) (list (list x_)) (list x_),- prim2 DefLists.intersperse Lists.intersperse [_x] x_ (list x_) (list x_),- prim1 DefLists.last Lists.last [_x] (list x_) (optional x_),- prim1 DefLists.length Lists.length [_x] (list x_) int32,- prim2 DefLists.map Lists.map [_x, _y] (funT x_ y_) (list x_) (list y_),- prim2 DefLists.mapList Lists.mapList [_x, _y] (fun x_ (list y_)) (list x_) (list (list y_)),- prim2 DefLists.mapOptional Lists.mapOptional [_x, _y] (fun x_ (list y_)) (optional x_) (list (optional y_)),- prim2 DefLists.mapSet Lists.mapSet [_xOrd, _yOrd] (fun x_ (list y_)) (set x_) (list (set y_)),- prim2 DefLists.member Lists.member [_xEq] x_ (list x_) boolean,- prim2 DefLists.maybeAt Lists.maybeAt [_x] int32 (list x_) (optional x_),- prim1 DefLists.maybeHead Lists.maybeHead [_x] (list x_) (optional x_),- prim1 DefLists.maybeInit Lists.maybeInit [_x] (list x_) (optional (list x_)),- prim1 DefLists.maybeLast Lists.maybeLast [_x] (list x_) (optional x_),- prim1 DefLists.maybeTail Lists.maybeTail [_x] (list x_) (optional (list x_)),- prim1 DefLists.nub Lists.nub [_xEq] (list x_) (list x_),- prim1 DefLists.null Lists.null [_x] (list x_) boolean,- prim2 DefLists.partition Lists.partition [_x] (fun x_ boolean) (list x_) (pair (list x_) (list x_)),- prim1 DefLists.pure Lists.pure [_x] x_ (list x_),- prim2 DefLists.replicate Lists.replicate [_x] int32 x_ (list x_),- prim1 DefLists.reverse Lists.reverse [_x] (list x_) (list x_),- prim1 DefLists.singleton Lists.singleton [_x] x_ (list x_),- prim1 DefLists.sort Lists.sort [_xOrd] (list x_) (list x_),- prim2 DefLists.sortBy Lists.sortBy [_x, _yOrd] (fun x_ y_) (list x_) (list x_),- prim2 DefLists.sortOn Lists.sortOn [_x, _yOrd] (fun x_ y_) (list x_) (list x_),- prim2 DefLists.span Lists.span [_x] (fun x_ boolean) (list x_) (pair (list x_) (list x_)),- prim1 DefLists.tail Lists.tail [_x] (list x_) (optional (list x_)),- prim2 DefLists.take Lists.take [_x] int32 (list x_) (list x_),- prim2 DefLists.takeWhile Lists.takeWhile [_x] (fun x_ boolean) (list x_) (list x_),- prim1 DefLists.transpose Lists.transpose [_x] (list (list x_)) (list (list x_)),- prim1 DefLists.uncons Lists.uncons [_x] (list x_) (optional (pair x_ (list x_))),- prim2 DefLists.zip Lists.zip [_x, _y] (list x_) (list y_) (list (pair x_ y_)),- prim3 DefLists.zipWith Lists.zipWith [_x, _y, _z] (funT x_ $ funT y_ z_) (list x_) (list y_) (list z_)]+ prim2 DefLists.apply Lists.apply (list $ funT x_ y_) (list x_) (list y_),+ prim2 DefLists.at Lists.at int32 (list x_) (optional x_),+ prim2 DefLists.bind Lists.bind (list x_) (fun x_ (list y_)) (list y_),+ prim3 DefLists.compose Lists.compose (fun x_ (list y_)) (fun y_ (list z_)) x_ (list z_),+ prim1 DefLists.concat Lists.concat (list (list x_)) (list x_),+ prim2 DefLists.concat2 Lists.concat2 (list x_) (list x_) (list x_),+ prim2 DefLists.cons Lists.cons x_ (list x_) (list x_),+ prim1 DefLists.distinct Lists.distinct (list x_) (list x_),+ prim2 DefLists.drop Lists.drop int32 (list x_) (list x_),+ prim2 DefLists.dropWhile Lists.dropWhile (fun x_ boolean) (list x_) (list x_),+ prim2 DefLists.member Lists.member x_ (list x_) boolean,+ prim2 DefLists.filter Lists.filter (fun x_ boolean) (list x_) (list x_),+ prim2 DefLists.find Lists.find (fun x_ boolean) (list x_) (optional x_),+ prim3 DefLists.foldList Lists.foldList (fun x_ (fun y_ (list x_))) x_ (list y_) (list x_),+ prim3 DefLists.foldl Lists.foldl (funT y_ (funT x_ y_)) y_ (list x_) y_,+ prim3 DefLists.foldr Lists.foldr (funT x_ (funT y_ y_)) y_ (list x_) y_,+ prim1 DefLists.group Lists.group (list x_) (list (list x_)),+ prim1 DefLists.head Lists.head (list x_) (optional x_),+ prim1 DefLists.init Lists.init (list x_) (optional (list x_)),+ prim2 DefLists.join Lists.join (list x_) (list (list x_)) (list x_),+ prim2 DefLists.join Lists.join (list x_) (list (list x_)) (list x_),+ prim2 DefLists.intersperse Lists.intersperse x_ (list x_) (list x_),+ prim1 DefLists.last Lists.last (list x_) (optional x_),+ prim1 DefLists.length Lists.length (list x_) int32,+ prim2 DefLists.map Lists.map (funT x_ y_) (list x_) (list y_),+ prim2 DefLists.mapList Lists.mapList (fun x_ (list y_)) (list x_) (list (list y_)),+ prim2 DefLists.mapOptional Lists.mapOptional (fun x_ (list y_)) (optional x_) (list (optional y_)),+ prim2 DefLists.mapSet Lists.mapSet (fun x_ (list y_)) (set x_) (list (set y_)),+ prim2 DefLists.member Lists.member x_ (list x_) boolean,+ prim2 DefLists.at Lists.at int32 (list x_) (optional x_),+ prim1 DefLists.head Lists.head (list x_) (optional x_),+ prim1 DefLists.init Lists.init (list x_) (optional (list x_)),+ 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,+ 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_),+ prim1 DefLists.sort Lists.sort (list x_) (list x_),+ prim2 DefLists.sortBy Lists.sortBy (fun x_ y_) (list x_) (list x_),+ prim2 DefLists.sortBy Lists.sortBy (fun x_ y_) (list x_) (list x_),+ prim2 DefLists.span Lists.span (fun x_ boolean) (list x_) (pair (list x_) (list x_)),+ prim1 DefLists.tail Lists.tail (list x_) (optional (list x_)),+ prim2 DefLists.take Lists.take int32 (list x_) (list x_),+ prim2 DefLists.takeWhile Lists.takeWhile (fun x_ boolean) (list x_) (list x_),+ prim1 DefLists.transpose Lists.transpose (list (list x_)) (list (list x_)),+ prim1 DefLists.uncons Lists.uncons (list x_) (optional (pair x_ (list x_))),+ prim2 DefLists.zip Lists.zip (list x_) (list y_) (list (pair x_ y_)),+ prim3 DefLists.zipWith Lists.zipWith (funT x_ $ funT y_ z_) (list x_) (list y_) (list z_)] hydraLibLiterals :: Library hydraLibLiterals = standardLibrary [- prim1 DefLiterals.bigintToDecimal Literals.bigintToDecimal [] bigint decimal,- prim1 DefLiterals.bigintToInt8 Literals.bigintToInt8 [] bigint int8,- prim1 DefLiterals.bigintToInt16 Literals.bigintToInt16 [] bigint int16,- prim1 DefLiterals.bigintToInt32 Literals.bigintToInt32 [] bigint int32,- prim1 DefLiterals.bigintToInt64 Literals.bigintToInt64 [] bigint int64,- prim1 DefLiterals.bigintToUint8 Literals.bigintToUint8 [] bigint uint8,- prim1 DefLiterals.bigintToUint16 Literals.bigintToUint16 [] bigint uint16,- prim1 DefLiterals.bigintToUint32 Literals.bigintToUint32 [] bigint uint32,- prim1 DefLiterals.bigintToUint64 Literals.bigintToUint64 [] bigint uint64,- prim1 DefLiterals.binaryToBytes Literals.binaryToBytes [] binary (list int32),- prim1 DefLiterals.binaryToString Literals.binaryToString [] binary string,- prim1 DefLiterals.decimalToBigint Literals.decimalToBigint [] decimal bigint,- prim1 DefLiterals.decimalToFloat32 Literals.decimalToFloat32 [] decimal float32,- prim1 DefLiterals.decimalToFloat64 Literals.decimalToFloat64 [] decimal float64,- prim1 DefLiterals.float32ToDecimal Literals.float32ToDecimal [] float32 decimal,- prim1 DefLiterals.float32ToFloat64 Literals.float32ToFloat64 [] float32 float64,- prim1 DefLiterals.float64ToDecimal Literals.float64ToDecimal [] float64 decimal,- prim1 DefLiterals.float64ToFloat32 Literals.float64ToFloat32 [] float64 float32,- prim1 DefLiterals.int8ToBigint Literals.int8ToBigint [] int8 bigint,- 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.readBoolean Literals.readBoolean [] 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.readString Literals.readString [] 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.showBoolean Literals.showBoolean [] 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.showString Literals.showString [] 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.stringToBinary Literals.stringToBinary [] string binary,- prim1 DefLiterals.uint8ToBigint Literals.uint8ToBigint [] uint8 bigint,- prim1 DefLiterals.uint16ToBigint Literals.uint16ToBigint [] uint16 bigint,- prim1 DefLiterals.uint32ToBigint Literals.uint32ToBigint [] uint32 bigint,- prim1 DefLiterals.uint64ToBigint Literals.uint64ToBigint [] uint64 bigint]+ prim1 DefLiterals.bigintToDecimal Literals.bigintToDecimal bigint decimal,+ prim1 DefLiterals.bigintToInt8 Literals.bigintToInt8 bigint int8,+ prim1 DefLiterals.bigintToInt16 Literals.bigintToInt16 bigint int16,+ prim1 DefLiterals.bigintToInt32 Literals.bigintToInt32 bigint int32,+ prim1 DefLiterals.bigintToInt64 Literals.bigintToInt64 bigint int64,+ prim1 DefLiterals.bigintToUint8 Literals.bigintToUint8 bigint uint8,+ prim1 DefLiterals.bigintToUint16 Literals.bigintToUint16 bigint uint16,+ prim1 DefLiterals.bigintToUint32 Literals.bigintToUint32 bigint uint32,+ prim1 DefLiterals.bigintToUint64 Literals.bigintToUint64 bigint uint64,+ prim1 DefLiterals.binaryToBytes Literals.binaryToBytes binary (list int32),+ prim1 DefLiterals.binaryToBase64 Literals.binaryToBase64 binary string,+ prim1 DefLiterals.decimalToBigint Literals.decimalToBigint decimal bigint,+ prim1 DefLiterals.decimalToFloat32 Literals.decimalToFloat32 decimal float32,+ prim1 DefLiterals.decimalToFloat64 Literals.decimalToFloat64 decimal float64,+ prim1 DefLiterals.float32ToDecimal Literals.float32ToDecimal float32 decimal,+ prim1 DefLiterals.float32ToFloat64 Literals.float32ToFloat64 float32 float64,+ prim1 DefLiterals.float64ToDecimal Literals.float64ToDecimal float64 decimal,+ prim1 DefLiterals.float64ToFloat32 Literals.float64ToFloat32 float64 float32,+ prim1 DefLiterals.int8ToBigint Literals.int8ToBigint int8 bigint,+ 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.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.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.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.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.base64ToBinary Literals.base64ToBinary string binary,+ prim1 DefLiterals.uint8ToBigint Literals.uint8ToBigint uint8 bigint,+ prim1 DefLiterals.uint16ToBigint Literals.uint16ToBigint uint16 bigint,+ prim1 DefLiterals.uint32ToBigint Literals.uint32ToBigint uint32 bigint,+ prim1 DefLiterals.uint64ToBigint Literals.uint64ToBigint uint64 bigint] hydraLibLogic :: Library hydraLibLogic = standardLibrary [- prim2 DefLogic.and Logic.and [] boolean boolean boolean,- Prims.lazyArgs [1, 2] $ prim3 DefLogic.ifElse Logic.ifElse [_x] boolean x_ x_ x_,- prim1 DefLogic.not Logic.not [] boolean boolean,- prim2 DefLogic.or Logic.or [] boolean boolean boolean]+ prim2 DefLogic.and Logic.and boolean boolean boolean,+ prim3 DefLogic.ifElse Logic.ifElse boolean x_ x_ x_,+ prim1 DefLogic.not Logic.not boolean boolean,+ prim2 DefLogic.or Logic.or boolean boolean boolean] hydraLibMaps :: Library hydraLibMaps = standardLibrary [- prim3 DefMaps.alter Maps.alter [_v, _kOrd] (fun (optional v_) (optional v_)) k_ mapKv mapKv,- prim3 DefMaps.bimap Maps.bimap [_k1Ord, _k2Ord, _v1, _v2] (fun k1_ k2_) (fun v1_ v2_) (Prims.map k1_ v1_) (Prims.map k2_ v2_),- prim2 DefMaps.delete Maps.delete [_kOrd, _v] k_ mapKv mapKv,- prim2 DefMaps.difference Maps.difference [_kOrd, _v] mapKv mapKv mapKv,- prim1 DefMaps.elems Maps.elems [_kOrd, _v] mapKv (list v_),- prim0 DefMaps.empty Maps.empty [_kOrd, _v] mapKv,- prim2 DefMaps.filter Maps.filter [_v, _kOrd] (fun v_ boolean) mapKv mapKv,- prim2 DefMaps.filterWithKey Maps.filterWithKey [_kOrd, _v] (fun k_ (fun v_ boolean)) mapKv mapKv,- Prims.lazyArgs [0] $ prim3 DefMaps.findWithDefault Maps.findWithDefault [_v, _kOrd] v_ k_ mapKv v_,- prim1 DefMaps.fromList Maps.fromList [_kOrd, _v] (list $ pair k_ v_) mapKv,- prim3 DefMaps.insert Maps.insert [_kOrd, _v] k_ v_ mapKv mapKv,- prim2 DefMaps.intersection Maps.intersection [_kOrd, _v] mapKv mapKv mapKv,- prim1 DefMaps.keys Maps.keys [_kOrd, _v] mapKv (list k_),- prim2 DefMaps.lookup Maps.lookup [_kOrd, _v] k_ mapKv (optional v_),- prim2 DefMaps.map Maps.map [_v1, _v2, _kOrd] (funT v1_ v2_) (Prims.map k_ v1_) (Prims.map k_ v2_),- prim2 DefMaps.mapKeys Maps.mapKeys [_k1Ord, _k2Ord, _v] (fun k1_ k2_) (Prims.map k1_ v_) (Prims.map k2_ v_),- prim2 DefMaps.member Maps.member [_kOrd, _v] k_ mapKv boolean,- prim1 DefMaps.null Maps.null [_kOrd, _v] mapKv boolean,- prim2 DefMaps.singleton Maps.singleton [_kOrd, _v] k_ v_ mapKv,- prim1 DefMaps.size Maps.size [_kOrd, _v] mapKv int32,- prim1 DefMaps.toList Maps.toList [_kOrd, _v] mapKv (list $ pair k_ v_),- prim2 DefMaps.union Maps.union [_kOrd, _v] mapKv mapKv mapKv,- prim1 DefMaps.unions Maps.unions [_kOrd, _v] (list mapKv) mapKv]+ prim3 DefMaps.alter Maps.alter (fun (optional v_) (optional v_)) k_ mapKv mapKv,+ prim3 DefMaps.bimap Maps.bimap (fun k1_ k2_) (fun v1_ v2_) (Prims.map k1_ v1_) (Prims.map k2_ v2_),+ prim2 DefMaps.delete Maps.delete k_ mapKv mapKv,+ prim2 DefMaps.difference Maps.difference mapKv mapKv mapKv,+ prim1 DefMaps.elems Maps.elems mapKv (list v_),+ prim0 DefMaps.empty Maps.empty mapKv,+ prim2 DefMaps.filter Maps.filter (fun v_ boolean) mapKv mapKv,+ prim2 DefMaps.filterWithKey Maps.filterWithKey (fun k_ (fun v_ boolean)) mapKv mapKv,+ prim3 DefMaps.findWithDefault Maps.findWithDefault v_ k_ mapKv v_,+ prim1 DefMaps.fromList Maps.fromList (list $ pair k_ v_) mapKv,+ prim3 DefMaps.insert Maps.insert k_ v_ mapKv mapKv,+ prim2 DefMaps.intersection Maps.intersection mapKv mapKv mapKv,+ prim1 DefMaps.keys Maps.keys mapKv (list k_),+ prim2 DefMaps.lookup Maps.lookup k_ mapKv (optional v_),+ 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,+ 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_),+ prim2 DefMaps.union Maps.union mapKv mapKv mapKv,+ prim1 DefMaps.unions Maps.unions (list mapKv) mapKv] where mapKv = Prims.map k_ v_ hydraLibMathFloat64 :: Library hydraLibMathFloat64 = standardLibrary [- prim1 DefMath.acos Math.acos [] float64 float64,- prim1 DefMath.acosh Math.acosh [] float64 float64,- prim2 DefMath.addFloat64 Math.addFloat64 [] float64 float64 float64,- prim1 DefMath.asin Math.asin [] float64 float64,- prim1 DefMath.asinh Math.asinh [] float64 float64,- prim1 DefMath.atan Math.atan [] float64 float64,- prim2 DefMath.atan2 Math.atan2 [] float64 float64 float64,- prim1 DefMath.atanh Math.atanh [] float64 float64,- prim1 DefMath.ceiling Math.ceiling [] float64 float64,- prim1 DefMath.cos Math.cos [] float64 float64,- prim1 DefMath.cosh Math.cosh [] float64 float64,- prim0 DefMath.e Math.e [] float64,- prim1 DefMath.exp Math.exp [] float64 float64,- prim1 DefMath.floor Math.floor [] float64 float64,- prim1 DefMath.log Math.log [] float64 float64,- prim2 DefMath.logBase Math.logBase [] float64 float64 float64,- prim2 DefMath.mulFloat64 Math.mulFloat64 [] float64 float64 float64,- prim1 DefMath.negateFloat64 Math.negateFloat64 [] float64 float64,- prim0 DefMath.pi Math.pi [] float64,- prim2 DefMath.pow Math.pow [] float64 float64 float64,- prim1 DefMath.round Math.round [] float64 float64,- prim2 DefMath.roundFloat32 Math.roundFloat32 [] int32 float32 float32,- prim2 DefMath.roundFloat64 Math.roundFloat64 [] int32 float64 float64,- prim1 DefMath.sin Math.sin [] float64 float64,- prim1 DefMath.sinh Math.sinh [] float64 float64,- prim1 DefMath.sqrt Math.sqrt [] float64 float64,- prim2 DefMath.subFloat64 Math.subFloat64 [] float64 float64 float64,- prim1 DefMath.tan Math.tan [] float64 float64,- prim1 DefMath.tanh Math.tanh [] float64 float64,- prim1 DefMath.truncate Math.truncate [] float64 float64]+ prim1 DefMath.acos Math.acos float64 float64,+ prim1 DefMath.acosh Math.acosh float64 float64,+ prim2 DefMath.addFloat64 Math.addFloat64 float64 float64 float64,+ prim1 DefMath.asin Math.asin float64 float64,+ prim1 DefMath.asinh Math.asinh float64 float64,+ prim1 DefMath.atan Math.atan float64 float64,+ prim2 DefMath.atan2 Math.atan2 float64 float64 float64,+ prim1 DefMath.atanh Math.atanh float64 float64,+ prim1 DefMath.ceiling Math.ceiling float64 float64,+ prim1 DefMath.cos Math.cos float64 float64,+ prim1 DefMath.cosh Math.cosh float64 float64,+ prim0 DefMath.e Math.e float64,+ prim1 DefMath.exp Math.exp float64 float64,+ prim1 DefMath.floor Math.floor float64 float64,+ prim1 DefMath.log Math.log float64 float64,+ prim2 DefMath.logBase Math.logBase float64 float64 float64,+ prim2 DefMath.mulFloat64 Math.mulFloat64 float64 float64 float64,+ prim1 DefMath.negateFloat64 Math.negateFloat64 float64 float64,+ prim0 DefMath.pi Math.pi float64,+ prim2 DefMath.pow Math.pow float64 float64 float64,+ prim1 DefMath.round Math.round float64 float64,+ prim2 DefMath.roundFloat32 Math.roundFloat32 int32 float32 float32,+ prim2 DefMath.roundFloat64 Math.roundFloat64 int32 float64 float64,+ prim1 DefMath.sin Math.sin float64 float64,+ prim1 DefMath.sinh Math.sinh float64 float64,+ prim1 DefMath.sqrt Math.sqrt float64 float64,+ prim2 DefMath.subFloat64 Math.subFloat64 float64 float64 float64,+ prim1 DefMath.tan Math.tan float64 float64,+ prim1 DefMath.tanh Math.tanh float64 float64,+ prim1 DefMath.truncate Math.truncate float64 float64] hydraLibMathInt32 :: Library hydraLibMathInt32 = standardLibrary [- prim1 DefMath.abs Math.abs [] int32 int32,- prim2 DefMath.add Math.add [] int32 int32 int32,- prim1 DefMath.even Math.even [] int32 boolean,- prim2 DefMath.max Math.max [] int32 int32 int32,- prim2 DefMath.maybeDiv Math.maybeDiv [] int32 int32 (optional int32),- prim2 DefMath.min Math.min [] int32 int32 int32,- prim2 DefMath.maybeMod Math.maybeMod [] int32 int32 (optional int32),- prim2 DefMath.mul Math.mul [] int32 int32 int32,- prim1 DefMath.negate Math.negate [] int32 int32,- prim1 DefMath.odd Math.odd [] int32 boolean,- prim1 DefMath.maybePred Math.maybePred [] int32 (optional int32),- prim2 DefMath.range Math.range [] int32 int32 (list int32),- prim2 DefMath.maybeRem Math.maybeRem [] int32 int32 (optional int32),- prim1 DefMath.signum Math.signum [] int32 int32,- prim2 DefMath.sub Math.sub [] int32 int32 int32,- prim1 DefMath.maybeSucc Math.maybeSucc [] int32 (optional int32)]+ prim1 DefMath.abs Math.abs int32 int32,+ prim2 DefMath.add Math.addTerm x_ x_ x_,+ prim1 DefMath.even Math.even int32 boolean,+ prim2 DefMath.div Math.div int32 int32 (optional int32),+ prim2 DefMath.mod Math.mod int32 int32 (optional int32),+ prim2 DefMath.mul Math.mulTerm x_ x_ x_,+ prim1 DefMath.negate Math.negateTerm x_ x_,+ prim1 DefMath.odd Math.odd int32 boolean,+ prim2 DefMath.range Math.range int32 int32 (list int32),+ prim2 DefMath.rem Math.rem int32 int32 (optional int32),+ prim1 DefMath.signum Math.signum int32 int32,+ prim2 DefMath.sub Math.subTerm x_ x_ x_] hydraLibOptionals :: Library hydraLibOptionals = standardLibrary [- prim2 DefOptionals.apply Optionals.apply [_x, _y] (optional $ funT x_ y_) (optional x_) (optional y_),- prim2 DefOptionals.bind Optionals.bind [_x, _y] (optional x_) (fun x_ (optional y_)) (optional y_),- Prims.lazyArgs [1] $ prim3 DefOptionals.cases Optionals.cases [_x, _y] (optional x_) y_ (funT x_ y_) y_,- prim1 DefOptionals.cat Optionals.cat [_x] (list $ optional x_) (list x_),- prim3 DefOptionals.compose Optionals.compose [_x, _y, _z] (fun x_ $ optional y_) (fun y_ $ optional z_) x_ (optional z_),- prim3 DefOptionals.foldList Optionals.foldList [_x, _y] (fun x_ (fun y_ (optional x_))) x_ (list y_) (optional x_),- Prims.lazyArgs [0] $ prim2 DefOptionals.fromOptional Optionals.fromOptional [_x] x_ (optional x_) x_,- prim1 DefOptionals.givens Optionals.givens [_x] (list $ optional x_) (list x_),- prim1 DefOptionals.isGiven Optionals.isGiven [_x] (optional x_) boolean,- prim1 DefOptionals.isNone Optionals.isNone [_x] (optional x_) boolean,- prim2 DefOptionals.map Optionals.map [_x, _y] (funT x_ y_) (optional x_) (optional y_),- prim2 DefOptionals.mapList Optionals.mapList [_x, _y] (fun x_ (optional y_)) (list x_) (optional (list y_)),- prim2 DefOptionals.mapOptional Optionals.mapOptional [_x, _y] (fun x_ $ optional y_) (list x_) (list y_),- prim2 DefOptionals.mapSet Optionals.mapSet [_xOrd, _yOrd] (fun x_ (optional y_)) (set x_) (optional (set y_)),- prim1 DefOptionals.pure Optionals.pure [_x] x_ (optional x_),- prim1 DefOptionals.toList Optionals.toList [_x] (optional x_) (list x_),- Prims.lazyArgs [0] $ prim2 DefOptionals.withDefault Optionals.withDefault [_x] x_ (optional x_) x_]+ prim2 DefOptionals.apply Optionals.apply (optional $ funT x_ y_) (optional x_) (optional y_),+ prim2 DefOptionals.bind Optionals.bind (optional x_) (fun x_ (optional y_)) (optional y_),+ prim3 DefOptionals.cases Optionals.cases (optional x_) y_ (funT x_ y_) y_,+ prim1 DefOptionals.givens Optionals.givens (list $ optional x_) (list x_),+ prim3 DefOptionals.compose Optionals.compose (fun x_ $ optional y_) (fun y_ $ optional z_) x_ (optional z_),+ prim3 DefOptionals.foldList Optionals.foldList (fun x_ (fun y_ (optional x_))) x_ (list y_) (optional x_),+ prim2 DefOptionals.withDefault Optionals.withDefault x_ (optional x_) x_,+ prim1 DefOptionals.givens Optionals.givens (list $ optional x_) (list x_),+ prim1 DefOptionals.isGiven Optionals.isGiven (optional x_) boolean,+ prim1 DefOptionals.isNone Optionals.isNone (optional x_) boolean,+ prim2 DefOptionals.map Optionals.map (funT x_ y_) (optional x_) (optional y_),+ 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.toList Optionals.toList (optional x_) (list x_),+ prim2 DefOptionals.withDefault Optionals.withDefault x_ (optional x_) x_] hydraLibPairs :: Library hydraLibPairs = standardLibrary [- prim3 DefPairs.bimap Pairs.bimap [_a, _b, _c, _d] (funT a_ c_) (funT b_ d_) (pair a_ b_) (pair c_ d_),- prim1 DefPairs.first Pairs.first [_a, _b] (pair a_ b_) a_,- prim1 DefPairs.second Pairs.second [_a, _b] (pair a_ b_) b_]+ 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_,+ prim1 DefPairs.second Pairs.second (pair a_ b_) b_] hydraLibRegex :: Library hydraLibRegex = standardLibrary [- prim2 DefRegex.find Regex.find [] string string (optional string),- prim2 DefRegex.findAll Regex.findAll [] string string (list string),- prim2 DefRegex.matches Regex.matches [] string string boolean,- prim3 DefRegex.replace Regex.replace [] string string string string,- prim3 DefRegex.replaceAll Regex.replaceAll [] string string string string,- prim2 DefRegex.split Regex.split [] string string (list string)]+ prim2 DefRegex.find Regex.find string string (optional string),+ prim2 DefRegex.findAll Regex.findAll string string (list string),+ prim2 DefRegex.matches Regex.matches string string boolean,+ prim3 DefRegex.replace Regex.replace string string string string,+ prim3 DefRegex.replaceAll Regex.replaceAll string string string string,+ prim2 DefRegex.split Regex.split string string (list string)] hydraLibSets :: Library hydraLibSets = standardLibrary [- prim2 DefSets.delete Sets.delete [_xOrd] x_ (set x_) (set x_),- prim2 DefSets.difference Sets.difference [_xOrd] (set x_) (set x_) (set x_),- prim0 DefSets.empty Sets.empty [_xOrd] (set x_),- prim2 DefSets.filter Sets.filter [_xOrd] (fun x_ boolean) (set x_) (set x_),- prim1 DefSets.fromList Sets.fromList [_xOrd] (list x_) (set x_),- prim2 DefSets.insert Sets.insert [_xOrd] x_ (set x_) (set x_),- prim2 DefSets.intersection Sets.intersection [_xOrd] (set x_) (set x_) (set x_),- prim2 DefSets.map Sets.map [_xOrd, _yOrd] (fun x_ y_) (set x_) (set y_),- prim2 DefSets.member Sets.member [_xOrd] x_ (set x_) boolean,- prim1 DefSets.null Sets.null [_xOrd] (set x_) boolean,- prim1 DefSets.singleton Sets.singleton [_xOrd] x_ (set x_),- prim1 DefSets.size Sets.size [_xOrd] (set x_) int32,- prim1 DefSets.toList Sets.toList [_xOrd] (set x_) (list x_),- prim2 DefSets.union Sets.union [_xOrd] (set x_) (set x_) (set x_),- prim1 DefSets.unions Sets.unions [_xOrd] (list $ set x_) (set x_)]+ prim2 DefSets.delete Sets.delete x_ (set x_) (set x_),+ prim2 DefSets.difference Sets.difference (set x_) (set x_) (set x_),+ prim0 DefSets.empty Sets.empty (set x_),+ prim2 DefSets.filter Sets.filter (fun x_ boolean) (set x_) (set x_),+ prim1 DefSets.fromList Sets.fromList (list x_) (set x_),+ prim2 DefSets.insert Sets.insert x_ (set x_) (set x_),+ 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.singleton Sets.singleton x_ (set x_),+ prim1 DefSets.size Sets.size (set x_) int32,+ prim1 DefSets.toList Sets.toList (set x_) (list x_),+ prim2 DefSets.union Sets.union (set x_) (set x_) (set x_),+ prim1 DefSets.unions Sets.unions (list $ set x_) (set x_)] hydraLibStrings :: Library hydraLibStrings = standardLibrary [- prim1 DefStrings.cat Strings.cat [] (list string) string,- prim2 DefStrings.cat2 Strings.cat2 [] string string string,- prim2 DefStrings.charAt Strings.charAt [] int32 string (optional int32),- prim1 DefStrings.concat Strings.concat [] (list string) string,- prim2 DefStrings.concat2 Strings.concat2 [] string string string,- prim1 DefStrings.fromList Strings.fromList [] (list int32) string,- prim2 DefStrings.intercalate Strings.intercalate [] string (list string) string,- prim2 DefStrings.join Strings.join [] string (list string) string,- prim1 DefStrings.length Strings.length [] string int32,- prim1 DefStrings.lines Strings.lines [] string (list string),- prim2 DefStrings.maybeCharAt Strings.maybeCharAt [] int32 string (optional int32),- prim1 DefStrings.null Strings.null [] 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,- prim1 DefStrings.toUpper Strings.toUpper [] string string,- prim1 DefStrings.unlines Strings.unlines [] (list string) string]+ prim1 DefStrings.concat Strings.concat (list string) string,+ prim2 DefStrings.concat2 Strings.concat2 string string string,+ prim2 DefStrings.charAt Strings.charAt int32 string (optional int32),+ prim1 DefStrings.concat Strings.concat (list string) string,+ prim2 DefStrings.concat2 Strings.concat2 string string string,+ prim1 DefStrings.fromList Strings.fromList (list int32) string,+ prim2 DefStrings.join Strings.join string (list string) string,+ prim2 DefStrings.join Strings.join string (list string) string,+ prim1 DefStrings.length Strings.length string int32,+ prim1 DefStrings.lines Strings.lines string (list string),+ prim2 DefStrings.charAt Strings.charAt int32 string (optional int32),+ prim1 DefStrings.null Strings.null 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,+ prim1 DefStrings.toUpper Strings.toUpper string string,+ prim1 DefStrings.unlines Strings.unlines (list string) string] hydraLibSystem :: Library hydraLibSystem = standardLibrary [@@ -482,13 +448,13 @@ hydraLibHashing :: Library hydraLibHashing = standardLibrary [- prim1 DefHashing.sha256 Hashing.sha256 [] binary binary,- prim1 DefHashing.sha256Hex Hashing.sha256Hex [] binary string]+ prim1 DefHashing.sha256 Hashing.sha256 binary binary,+ prim1 DefHashing.sha256Hex Hashing.sha256Hex binary string] hydraLibText :: Library hydraLibText = standardLibrary [- prim1 DefText.decodeUtf8 Text.decodeUtf8 [] binary (Prims.either_ string string),- prim1 DefText.encodeUtf8 Text.encodeUtf8 [] string binary]+ prim1 DefText.decodeUtf8 Text.decodeUtf8 binary (Prims.either_ string string),+ prim1 DefText.encodeUtf8 Text.encodeUtf8 string binary] standardLibraries :: [Library] standardLibraries = [@@ -506,6 +472,7 @@ hydraLibMathFloat64, hydraLibMathInt32, hydraLibOptionals,+ hydraLibOrdering, hydraLibPairs, hydraLibRegex, hydraLibSets,
src/main/haskell/Hydra/Parse/Docs.hs view
@@ -46,8 +46,8 @@ parseDocAnnotation inner = let parts = Strings.splitOn " " inner- tag = Optionals.fromOptional "" (Lists.maybeHead parts)- rhs = Strings.intercalate " " (Lists.drop 1 parts)+ tag = Optionals.withDefault "" (Lists.head parts)+ rhs = Strings.join " " (Lists.drop 1 parts) in (Logic.ifElse (Equality.equal tag "primitive") (Just (Packaging.EntityReferenceDefinition (Packaging.DefinitionReferencePrimitive (Core.Name rhs)))) (Logic.ifElse (Equality.equal tag "term") (Just (Packaging.EntityReferenceDefinition (Packaging.DefinitionReferenceTerm (Core.Name rhs)))) (Logic.ifElse (Equality.equal tag "type") (Just (Packaging.EntityReferenceDefinition (Packaging.DefinitionReferenceType (Core.Name rhs)))) (Logic.ifElse (Equality.equal tag "module") (Just (Packaging.EntityReferenceModule (Packaging.ModuleName rhs))) (Logic.ifElse (Equality.equal tag "package") (Just (Packaging.EntityReferencePackage (Packaging.PackageName rhs))) (Logic.ifElse (Equality.equal tag "term-expr") (Just (Packaging.EntityReferenceTermExpr rhs)) (Logic.ifElse (Equality.equal tag "type-expr") (Just (Packaging.EntityReferenceTypeExpr rhs)) Nothing))))))) -- | Parse a documentation string into a list of 'DocSegment's. Recognized doc-escape tags become DocSegment.ref segments (wrapping a 'EntityReference'); all other text (including unrecognized doc-escape blocks) becomes DocSegment.text segments. Adjacent text fragments are not merged.@@ -55,16 +55,16 @@ parseDocString s = let parts = Strings.splitOn "{@" s- head_ = Optionals.fromOptional "" (Lists.maybeHead parts)+ head_ = Optionals.withDefault "" (Lists.head parts) tail_ = Lists.drop 1 parts toSeg = \part -> let subparts = Strings.splitOn "}" part- inner = Optionals.fromOptional "" (Lists.maybeHead subparts)- after = Strings.intercalate "}" (Lists.drop 1 subparts)+ inner = Optionals.withDefault "" (Lists.head subparts)+ after = Strings.join "}" (Lists.drop 1 subparts) mref = parseDocAnnotation inner in (Optionals.cases mref [- Docs.DocSegmentText (Strings.cat2 "{@" part)] (\ref -> Optionals.cat [+ Docs.DocSegmentText (Strings.concat2 "{@" part)] (\ref -> Optionals.givens [ Just (Docs.DocSegmentRef ref), (Logic.ifElse (Equality.equal after "") Nothing (Just (Docs.DocSegmentText after)))])) in (Lists.cons (Docs.DocSegmentText head_) (Lists.concat (Lists.map toSeg tail_)))
src/main/haskell/Hydra/Parse/Regex.hs view
@@ -22,6 +22,7 @@ import qualified Hydra.Overlay.Haskell.Lib.Logic as Logic import qualified Hydra.Overlay.Haskell.Lib.Math as Math import qualified Hydra.Overlay.Haskell.Lib.Optionals as Optionals+import qualified Hydra.Overlay.Haskell.Lib.Ordering as Ordering import qualified Hydra.Packaging as Packaging import qualified Hydra.Parsers as Parsers import qualified Hydra.Parsing as Parsing@@ -47,7 +48,7 @@ alternation = Parsers.bind (Parsers.sepBy1 regexSequence (Parsers.char 124)) (\branches -> let hasEmpty = Lists.foldl (\acc -> \b -> Logic.or acc (Lists.null b)) False branches- multi = Equality.gt (Lists.length branches) 1+ multi = Ordering.gt (Lists.length branches) 1 in (Logic.ifElse (Logic.and hasEmpty multi) (Parsers.fail "empty alternation branch") (Parsers.pure branches))) -- | Parse a single atom: a group ( ... ), a class [ ... ], ., an anchor ^ or $, or a literal.@@ -142,4 +143,4 @@ -- | Parse a non-negative decimal integer (one or more digits). unsignedInt :: Parsing.Parser Int unsignedInt =- Parsers.map (\digits -> Lists.foldl (\acc -> \d -> Math.add (Math.mul acc 10) (Math.sub d 48)) 0 digits) (Parsers.some (Parsers.satisfy (\c -> Logic.and (Equality.gte c 48) (Equality.lte c 57))))+ Parsers.map (\digits -> Lists.foldl (\acc -> \d -> Math.add (Math.mul acc 10) (Math.sub d 48)) 0 digits) (Parsers.some (Parsers.satisfy (\c -> Logic.and (Ordering.gte c 48) (Ordering.lte c 57))))
src/main/haskell/Hydra/Parsers.hs view
@@ -149,7 +149,7 @@ let parse = \input -> let codes = Strings.toList input- in (Optionals.cases (Lists.maybeHead codes) (Parsing.ParseResultFailure (Parsing.ParseError {+ in (Optionals.cases (Lists.head codes) (Parsing.ParseResultFailure (Parsing.ParseError { Parsing.parseErrorMessage = "unexpected end of input", Parsing.parseErrorRemainder = input})) (\c -> let rest = Strings.fromList (Lists.drop 1 codes)@@ -183,5 +183,5 @@ in (Logic.ifElse (Equality.equal strCodes inputPrefix) (Parsing.ParseResultSuccess (Parsing.ParseSuccess { Parsing.parseSuccessValue = str, Parsing.parseSuccessRemainder = (Strings.fromList (Lists.drop strLen inputCodes))})) (Parsing.ParseResultFailure (Parsing.ParseError {- Parsing.parseErrorMessage = (Strings.cat2 "expected: " str),+ Parsing.parseErrorMessage = (Strings.concat2 "expected: " str), Parsing.parseErrorRemainder = input}))))
src/main/haskell/Hydra/Predicates.hs view
@@ -23,10 +23,12 @@ import qualified Hydra.Lexical as Lexical import qualified Hydra.Overlay.Haskell.Lib.Eithers as Eithers import qualified Hydra.Overlay.Haskell.Lib.Equality as Equality+import qualified Hydra.Overlay.Haskell.Lib.Functions as Functions 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.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@@ -62,7 +64,7 @@ mts = Core.bindingTypeScheme b in (Optionals.cases mts (isComplexTerm tc term) (\ts -> let isPolymorphic = Logic.not (Lists.null (Core.typeSchemeVariables ts))- isNonNullary = Equality.gt (Arity.typeArity (Core.typeSchemeBody ts)) 0+ isNonNullary = Ordering.gt (Arity.typeArity (Core.typeSchemeBody ts)) 0 isComplex = isComplexTerm tc term in (Logic.or (Logic.or isPolymorphic isNonNullary) isComplex))) @@ -85,7 +87,7 @@ let typeLookup = Maps.lookup name (Graph.graphBoundTypes tc) in (Optionals.cases typeLookup ( let primLookup = Maps.lookup name (Graph.graphPrimitives tc)- in (Optionals.cases primLookup True (\prim -> Equality.gt (Arity.typeSchemeArity (Scoping.termSignatureToTypeScheme (Packaging.primitiveDefinitionSignature (Graph.primitiveDefinition prim)))) 0))) (\ts -> Equality.gt (Arity.typeSchemeArity ts) 0)))))+ in (Optionals.cases primLookup True (\prim -> Ordering.gt (Arity.typeSchemeArity (Scoping.termSignatureToTypeScheme (Packaging.primitiveDefinitionSignature (Graph.primitiveDefinition prim)))) 0))) (\ts -> Ordering.gt (Arity.typeSchemeArity ts) 0))))) -- | Determines whether a given term is an encoded term (meta-level term) isEncodedTerm :: Core.Term -> Bool@@ -133,7 +135,7 @@ \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 Equality.identity (Core.bindingName el)))+ in (Logic.not (Logic.or (Sets.member Variants.TypeVariantEffect allVariants) (Sets.member Variants.TypeVariantFunction allVariants)))) (typeDependencies cx graph False Functions.identity (Core.bindingName el))) -- | Check if a type (by name) is serializable, resolving all type dependencies (Either version) isSerializableByName :: t0 -> Graph.Graph -> Core.Name -> Either Errors.Error Bool@@ -143,7 +145,7 @@ \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 Equality.identity name))+ in (Logic.not (Logic.or (Sets.member Variants.TypeVariantEffect allVariants) (Sets.member Variants.TypeVariantFunction allVariants)))) (typeDependencies cx graph False Functions.identity name)) -- | Check if a type is serializable (no function types in the type itself) isSerializableType :: Core.Type -> Bool
src/main/haskell/Hydra/Print/Core.hs view
@@ -54,11 +54,11 @@ let name = Core.unName (Core.bindingName el) t = Core.bindingTerm el typeStr =- Optionals.cases (Core.bindingTypeScheme el) "" (\ts -> Strings.cat [+ Optionals.cases (Core.bindingTypeScheme el) "" (\ts -> Strings.concat [ ":(", (typeScheme ts), ")"])- in (Strings.cat [+ in (Strings.concat [ name, typeStr, " = ",@@ -84,7 +84,7 @@ Lists.concat [ caseFields, defaultField]- in (Strings.cat [+ in (Strings.concat [ "case(", tname, ")",@@ -93,7 +93,7 @@ -- | Show an Either value using given functions for left and right either :: (t0 -> String) -> (t1 -> String) -> Either t0 t1 -> String either showA showB e =- Eithers.either (\a -> Strings.cat2 "left(" (Strings.cat2 (showA a) ")")) (\b -> Strings.cat2 "right(" (Strings.cat2 (showB b) ")")) e+ Eithers.either (\a -> Strings.concat2 "left(" (Strings.concat2 (showA a) ")")) (\b -> Strings.concat2 "right(" (Strings.concat2 (showB b) ")")) e -- | Show a field as a string field :: Core.Field -> String@@ -101,7 +101,7 @@ let fname = Core.unName (Core.fieldName field) fterm = Core.fieldTerm field- in (Strings.cat [+ in (Strings.concat [ fname, "=", (term fterm)])@@ -112,7 +112,7 @@ let fname = Core.unName (Core.fieldTypeName ft) ftyp = Core.fieldTypeType ft- in (Strings.cat [+ in (Strings.concat [ fname, ":", (type_ ftyp)])@@ -122,17 +122,17 @@ fields flds = let fieldStrs = Lists.map field flds- in (Strings.cat [+ in (Strings.concat [ "{",- (Strings.intercalate ", " fieldStrs),+ (Strings.join ", " fieldStrs), "}"]) -- | Show a float value as a string float :: Core.FloatValue -> String float fv = case fv of- Core.FloatValueFloat32 v0 -> Strings.cat2 (Literals.showFloat32 v0) ":float32"- Core.FloatValueFloat64 v0 -> Strings.cat2 (Literals.showFloat64 v0) ":float64"+ Core.FloatValueFloat32 v0 -> Strings.concat2 (Literals.showFloat32 v0) ":float32"+ Core.FloatValueFloat64 v0 -> Strings.concat2 (Literals.showFloat64 v0) ":float64" -- | Show a float type as a string floatType :: Core.FloatType -> String@@ -147,7 +147,7 @@ let tname = Core.injectionTypeName inj f = Core.injectionField inj- in (Strings.cat [+ in (Strings.concat [ "inject(", (Core.unName tname), ")",@@ -158,15 +158,15 @@ integer :: Core.IntegerValue -> String integer iv = case iv of- Core.IntegerValueBigint v0 -> Strings.cat2 (Literals.showBigint v0) ":bigint"- Core.IntegerValueInt8 v0 -> Strings.cat2 (Literals.showInt8 v0) ":int8"- Core.IntegerValueInt16 v0 -> Strings.cat2 (Literals.showInt16 v0) ":int16"- Core.IntegerValueInt32 v0 -> Strings.cat2 (Literals.showInt32 v0) ":int32"- Core.IntegerValueInt64 v0 -> Strings.cat2 (Literals.showInt64 v0) ":int64"- Core.IntegerValueUint8 v0 -> Strings.cat2 (Literals.showUint8 v0) ":uint8"- Core.IntegerValueUint16 v0 -> Strings.cat2 (Literals.showUint16 v0) ":uint16"- Core.IntegerValueUint32 v0 -> Strings.cat2 (Literals.showUint32 v0) ":uint32"- Core.IntegerValueUint64 v0 -> Strings.cat2 (Literals.showUint64 v0) ":uint64"+ 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" -- | Show an integer type as a string integerType :: Core.IntegerType -> String@@ -189,8 +189,8 @@ let v = Core.unName (Core.lambdaParameter l) mt = Core.lambdaDomain l body = Core.lambdaBody l- typeStr = Optionals.cases mt "" (\t -> Strings.cat2 ":" (type_ t))- in (Strings.cat [+ typeStr = Optionals.cases mt "" (\t -> Strings.concat2 ":" (type_ t))+ in (Strings.concat [ "\955", v, typeStr,@@ -204,9 +204,9 @@ let bindings = Core.letBindings l env = Core.letBody l bindingStrs = Lists.map binding bindings- in (Strings.cat [+ in (Strings.concat [ "let ",- (Strings.intercalate ", " bindingStrs),+ (Strings.join ", " bindingStrs), " in ", (term env)]) @@ -215,9 +215,9 @@ list f xs = let elementStrs = Lists.map f xs- in (Strings.cat [+ in (Strings.concat [ "[",- (Strings.intercalate ", " elementStrs),+ (Strings.join ", " elementStrs), "]"]) -- | Show a literal as a string@@ -229,7 +229,7 @@ Core.LiteralDecimal v0 -> Literals.showDecimal v0 Core.LiteralFloat v0 -> float v0 Core.LiteralInteger v0 -> integer v0- Core.LiteralString v0 -> Literals.showString v0+ Core.LiteralString v0 -> Literals.printString v0 -- | Show a literal type as a string literalType :: Core.LiteralType -> String@@ -247,23 +247,23 @@ map showK showV m = let pairStrs =- Lists.map (\p -> Strings.cat [+ Lists.map (\p -> Strings.concat [ showK (Pairs.first p), ": ", (showV (Pairs.second p))]) (Maps.toList m)- in (Strings.cat [+ in (Strings.concat [ "{",- (Strings.intercalate ", " pairStrs),+ (Strings.join ", " pairStrs), "}"]) -- | Show an optional value using a given function to show the element optional :: (t0 -> String) -> Maybe t0 -> String-optional f mx = Optionals.cases mx "none" (\x -> Strings.cat2 "given(" (Strings.cat2 (f x) ")"))+optional f mx = Optionals.cases mx "none" (\x -> Strings.concat2 "given(" (Strings.concat2 (f x) ")")) -- | Show a pair using given functions to show each element pair :: (t0 -> String) -> (t1 -> String) -> (t0, t1) -> String pair showA showB p =- Strings.cat [+ Strings.concat [ "(", (showA (Pairs.first p)), ", ",@@ -276,7 +276,7 @@ let tname = Core.unName (Core.projectionTypeName proj) fname = Core.unName (Core.projectionFieldName proj)- in (Strings.cat [+ in (Strings.concat [ "project(", tname, "){",@@ -292,9 +292,9 @@ set f xs = let elementStrs = Lists.map f (Sets.toList xs)- in (Strings.cat [+ in (Strings.concat [ "{",- (Strings.intercalate ", " elementStrs),+ (Strings.join ", " elementStrs), "}"]) -- | Show a term as a string@@ -313,15 +313,15 @@ Core.TermApplication v0 -> let terms = gatherTerms [] v0 termStrs = Lists.map term terms- in (Strings.cat [+ in (Strings.concat [ "(",- (Strings.intercalate " @ " termStrs),+ (Strings.join " @ " termStrs), ")"]) Core.TermCases v0 -> caseStatement v0- Core.TermEither v0 -> Eithers.either (\l -> Strings.cat [+ Core.TermEither v0 -> Eithers.either (\l -> Strings.concat [ "left(", (term l),- ")"]) (\r -> Strings.cat [+ ")"]) (\r -> Strings.concat [ "right(", (term r), ")"]) v0@@ -329,26 +329,26 @@ Core.TermLet v0 -> let_ v0 Core.TermList v0 -> let termStrs = Lists.map term v0- in (Strings.cat [+ in (Strings.concat [ "[",- (Strings.intercalate ", " termStrs),+ (Strings.join ", " termStrs), "]"]) Core.TermLiteral v0 -> literal v0 Core.TermMap v0 -> let entry =- \p -> Strings.cat [+ \p -> Strings.concat [ term (Pairs.first p), "=", (term (Pairs.second p))]- in (Strings.cat [+ in (Strings.concat [ "{",- (Strings.intercalate ", " (Lists.map entry (Maps.toList v0))),+ (Strings.join ", " (Lists.map entry (Maps.toList v0))), "}"])- Core.TermOptional v0 -> Optionals.cases v0 "none" (\t2 -> Strings.cat [+ Core.TermOptional v0 -> Optionals.cases v0 "none" (\t2 -> Strings.concat [ "given(", (term t2), ")"])- Core.TermPair v0 -> Strings.cat [+ Core.TermPair v0 -> Strings.concat [ "(", (term (Pairs.first v0)), ", ",@@ -358,19 +358,19 @@ Core.TermRecord v0 -> let tname = Core.unName (Core.recordTypeName v0) flds = Core.recordFields v0- in (Strings.cat [+ in (Strings.concat [ "record(", tname, ")", (fields flds)])- Core.TermSet v0 -> Strings.cat [+ Core.TermSet v0 -> Strings.concat [ "{",- (Strings.intercalate ", " (Lists.map term (Sets.toList v0))),+ (Strings.join ", " (Lists.map term (Sets.toList v0))), "}"] Core.TermTypeLambda v0 -> let param = Core.unName (Core.typeLambdaParameter v0) body = Core.typeLambdaBody v0- in (Strings.cat [+ in (Strings.concat [ "\923", param, ".",@@ -378,14 +378,14 @@ Core.TermTypeApplication v0 -> let t2 = Core.typeApplicationTermBody v0 typ = Core.typeApplicationTermType v0- in (Strings.cat [+ in (Strings.concat [ term t2, "\10216", (type_ typ), "\10217"]) Core.TermInject v0 -> injection v0 Core.TermUnit -> "unit"- Core.TermUnwrap v0 -> Strings.cat [+ Core.TermUnwrap v0 -> Strings.concat [ "unwrap(", (Core.unName v0), ")"]@@ -393,7 +393,7 @@ Core.TermWrap v0 -> let tname = Core.unName (Core.wrappedTermTypeName v0) term1 = Core.wrappedTermBody v0- in (Strings.cat [+ in (Strings.concat [ "wrap(", tname, "){",@@ -407,9 +407,9 @@ let showRowType = \flds -> let fieldStrs = Lists.map fieldType flds- in (Strings.cat [+ in (Strings.concat [ "{",- (Strings.intercalate ", " fieldStrs),+ (Strings.join ", " fieldStrs), "}"]) gatherTypes = \prev -> \app ->@@ -430,18 +430,18 @@ Core.TypeApplication v0 -> let types = gatherTypes [] v0 typeStrs = Lists.map type_ types- in (Strings.cat [+ in (Strings.concat [ "(",- (Strings.intercalate " @ " typeStrs),+ (Strings.join " @ " typeStrs), ")"])- Core.TypeEffect v0 -> Strings.cat [+ Core.TypeEffect v0 -> Strings.concat [ "effect<", (type_ v0), ">"] Core.TypeEither v0 -> let leftTyp = Core.eitherTypeLeft v0 rightTyp = Core.eitherTypeRight v0- in (Strings.cat [+ in (Strings.concat [ "either<", (type_ leftTyp), ", ",@@ -450,7 +450,7 @@ Core.TypeForall v0 -> let var = Core.unName (Core.forallTypeParameter v0) body = Core.forallTypeBody v0- in (Strings.cat [+ in (Strings.concat [ "(\8704", var, ".",@@ -459,11 +459,11 @@ Core.TypeFunction _ -> let types = gatherFunctionTypes [] typ typeStrs = Lists.map type_ types- in (Strings.cat [+ in (Strings.concat [ "(",- (Strings.intercalate " \8594 " typeStrs),+ (Strings.join " \8594 " typeStrs), ")"])- Core.TypeList v0 -> Strings.cat [+ Core.TypeList v0 -> Strings.concat [ "list<", (type_ v0), ">"]@@ -471,35 +471,35 @@ Core.TypeMap v0 -> let keyTyp = Core.mapTypeKeys v0 valTyp = Core.mapTypeValues v0- in (Strings.cat [+ in (Strings.concat [ "map<", (type_ keyTyp), ", ", (type_ valTyp), ">"])- Core.TypeOptional v0 -> Strings.cat [+ Core.TypeOptional v0 -> Strings.concat [ "optional<", (type_ v0), ">"] Core.TypePair v0 -> let firstTyp = Core.pairTypeFirst v0 secondTyp = Core.pairTypeSecond v0- in (Strings.cat [+ in (Strings.concat [ "(", (type_ firstTyp), ", ", (type_ secondTyp), ")"])- Core.TypeRecord v0 -> Strings.cat2 "record" (showRowType v0)- Core.TypeSet v0 -> Strings.cat [+ Core.TypeRecord v0 -> Strings.concat2 "record" (showRowType v0)+ Core.TypeSet v0 -> Strings.concat [ "set<", (type_ v0), ">"]- Core.TypeUnion v0 -> Strings.cat2 "union" (showRowType v0)+ Core.TypeUnion v0 -> Strings.concat2 "union" (showRowType v0) Core.TypeUnit -> "unit" Core.TypeVariable v0 -> Core.unName v0 Core.TypeVoid -> "void"- Core.TypeWrap v0 -> Strings.cat [+ Core.TypeWrap v0 -> Strings.concat [ "wrap(", (type_ v0), ")"]@@ -512,12 +512,12 @@ body = Core.typeSchemeBody ts varNames = Lists.map Core.unName vars fa =- Logic.ifElse (Lists.null vars) "" (Strings.cat [+ Logic.ifElse (Lists.null vars) "" (Strings.concat [ "forall ",- (Strings.intercalate "," varNames),+ (Strings.join "," varNames), ". "]) toConstraintPair =- \v -> \c -> Strings.cat [+ \v -> \c -> Strings.concat [ case c of Core.TypeClassConstraintSimple v0 -> Core.unName v0, " ",@@ -525,12 +525,12 @@ toConstraintPairs = \p -> Lists.map (toConstraintPair (Pairs.first p)) (Core.typeVariableConstraintsClasses (Pairs.second p)) tc = Optionals.cases (Core.typeSchemeConstraints ts) [] (\m -> Lists.concat (Lists.map toConstraintPairs (Maps.toList m)))- in (Strings.cat [+ in (Strings.concat [ "(", fa,- (Logic.ifElse (Lists.null tc) "" (Strings.cat [+ (Logic.ifElse (Lists.null tc) "" (Strings.concat [ "(",- (Strings.intercalate ", " tc),+ (Strings.join ", " tc), ") => "])), (type_ body), ")"])
src/main/haskell/Hydra/Print/Docs.hs view
@@ -60,24 +60,24 @@ -- | Render a list of DocSegments back to a plain documentation string docSegments :: [Docs.DocSegment] -> String-docSegments segs = Strings.cat (Lists.map docSegment segs)+docSegments segs = Strings.concat (Lists.map docSegment segs) -- | Render a list of DocSegments using a custom 'EntityReference' renderer docSegmentsWith :: (Packaging.EntityReference -> String) -> [Docs.DocSegment] -> String-docSegmentsWith render segs = Strings.cat (Lists.map (docSegmentWith render) segs)+docSegmentsWith render segs = Strings.concat (Lists.map (docSegmentWith render) segs) -- | Render a 'EntityReference' as its doc-escape tag string (without the surrounding braces) entityReference :: Packaging.EntityReference -> String entityReference x = case x of- Packaging.EntityReferenceDefinition v0 -> Strings.cat2 (case v0 of+ Packaging.EntityReferenceDefinition v0 -> Strings.concat2 (case v0 of Packaging.DefinitionReferencePrimitive _ -> "primitive" Packaging.DefinitionReferenceTerm _ -> "term"- Packaging.DefinitionReferenceType _ -> "type") (Strings.cat2 " " (definitionReference v0))- Packaging.EntityReferenceModule v0 -> Strings.cat2 "module " (Packaging.unModuleName v0)- Packaging.EntityReferencePackage v0 -> Strings.cat2 "package " (Packaging.unPackageName v0)- Packaging.EntityReferenceTermExpr v0 -> Strings.cat2 "term-expr " v0- Packaging.EntityReferenceTypeExpr v0 -> Strings.cat2 "type-expr " v0+ Packaging.DefinitionReferenceType _ -> "type") (Strings.concat2 " " (definitionReference v0))+ Packaging.EntityReferenceModule v0 -> Strings.concat2 "module " (Packaging.unModuleName v0)+ Packaging.EntityReferencePackage v0 -> Strings.concat2 "package " (Packaging.unPackageName v0)+ Packaging.EntityReferenceTermExpr v0 -> Strings.concat2 "term-expr " v0+ Packaging.EntityReferenceTypeExpr v0 -> Strings.concat2 "type-expr " v0 -- | Parse a documentation string and re-render it, converting doc-escape tags through their canonical form renderDocString :: String -> String
src/main/haskell/Hydra/Print/Emacs/Regex.hs view
@@ -43,7 +43,7 @@ -- | Render an alternation, joining its branches with Emacs's \| operator. alternation :: [[Regex.Quantified]] -> String-alternation alt = Strings.intercalate "\\|" (Lists.map regexSequence alt)+alternation alt = Strings.join "\\|" (Lists.map regexSequence alt) -- | The Emacs rendering of Hydra's . (any character incl. newline): the empty-negated-range [^z-a]. anyClass :: String@@ -57,7 +57,7 @@ Regex.AtomAny -> anyClass Regex.AtomAnchorStart -> "^" Regex.AtomAnchorEnd -> "$"- Regex.AtomGroup v0 -> Strings.cat [+ Regex.AtomGroup v0 -> Strings.concat [ "\\(", (alternation v0), "\\)"]@@ -66,10 +66,10 @@ -- | Render a character class, including the leading ^ for a negated class (POSIX-like in Emacs). characterClass :: Regex.CharacterClass -> String characterClass cc =- Strings.cat [+ Strings.concat [ "[", (Logic.ifElse (Regex.characterClassNegated cc) "^" ""),- (Strings.cat (Lists.map classItem (Regex.characterClassItems cc))),+ (Strings.concat (Lists.map classItem (Regex.characterClassItems cc))), "]"] -- | Render one character-class member (a single character or an inclusive range).@@ -77,7 +77,7 @@ classItem item = case item of Regex.ClassItemCharacter v0 -> escapeClassChar v0- Regex.ClassItemRange v0 -> Strings.cat [+ Regex.ClassItemRange v0 -> Strings.concat [ escapeClassChar (Regex.characterRangeFrom v0), "-", (escapeClassChar (Regex.characterRangeTo v0))]@@ -92,7 +92,7 @@ 93, 94, 45]- in (Logic.ifElse isMeta (Strings.cat2 "\\" (showCodePoint c)) (showCodePoint c))+ in (Logic.ifElse isMeta (Strings.concat2 "\\" (showCodePoint c)) (showCodePoint 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,7 +109,7 @@ 94, 36, 92]- in (Logic.ifElse isMeta (Strings.cat2 "\\" (showCodePoint c)) (showCodePoint c))+ in (Logic.ifElse isMeta (Strings.concat2 "\\" (showCodePoint c)) (showCodePoint c)) -- | Render a hydra.regex AST into GNU Emacs regexp syntax (escaped \| \( \) \{..\}, . as [^z-a]). printRegex :: [[Regex.Quantified]] -> String@@ -117,7 +117,7 @@ -- | Render an atom followed by its quantifier suffix. quantified :: Regex.Quantified -> String-quantified qa = Strings.cat2 (atom (Regex.quantifiedAtom qa)) (quantifier (Regex.quantifiedQuantifier qa))+quantified qa = Strings.concat2 (atom (Regex.quantifiedAtom qa)) (quantifier (Regex.quantifiedQuantifier qa)) -- | Render a quantifier suffix; bounded {..} forms use Emacs's escaped braces \{..\}. quantifier :: Regex.Quantifier -> String@@ -127,15 +127,15 @@ Regex.QuantifierZeroOrOne -> "?" Regex.QuantifierZeroOrMore -> "*" Regex.QuantifierOneOrMore -> "+"- Regex.QuantifierExactly v0 -> Strings.cat [+ Regex.QuantifierExactly v0 -> Strings.concat [ "\\{", (Literals.showInt32 v0), "\\}"]- Regex.QuantifierAtLeast v0 -> Strings.cat [+ Regex.QuantifierAtLeast v0 -> Strings.concat [ "\\{", (Literals.showInt32 v0), ",\\}"]- Regex.QuantifierRange_ v0 -> Strings.cat [+ Regex.QuantifierRange_ v0 -> Strings.concat [ "\\{", (Literals.showInt32 (Regex.quantifierRangeMin v0)), ",",@@ -144,7 +144,7 @@ -- | Render a sequence of quantified atoms by concatenation. regexSequence :: [Regex.Quantified] -> String-regexSequence s = Strings.cat (Lists.map quantified s)+regexSequence s = Strings.concat (Lists.map quantified s) -- | Render a single Unicode code point as a one-character string. showCodePoint :: Int -> String
src/main/haskell/Hydra/Print/Error/Core.hs view
@@ -44,42 +44,42 @@ -- | Show a constant condition error as a string constantConditionError :: ErrorCore.ConstantConditionError -> String constantConditionError e =- Strings.cat [+ Strings.concat [ "constant condition: ifElse with literal ",- (Literals.showBoolean (ErrorCore.constantConditionErrorValue e))]+ (Literals.printBoolean (ErrorCore.constantConditionErrorValue e))] -- | Show a duplicate binding error as a string duplicateBindingError :: ErrorCore.DuplicateBindingError -> String duplicateBindingError e =- Strings.cat [+ Strings.concat [ "duplicate binding: ", (Core.unName (ErrorCore.duplicateBindingErrorName e))] -- | Show a duplicate field error as a string duplicateFieldError :: ErrorCore.DuplicateFieldError -> String duplicateFieldError e =- Strings.cat [+ Strings.concat [ "duplicate field: ", (Core.unName (ErrorCore.duplicateFieldErrorName e))] -- | Show a duplicate record type field names error as a string duplicateRecordTypeFieldNamesError :: ErrorCore.DuplicateRecordTypeFieldNamesError -> String duplicateRecordTypeFieldNamesError e =- Strings.cat [+ Strings.concat [ "duplicate field in record type: ", (Core.unName (ErrorCore.duplicateRecordTypeFieldNamesErrorName e))] -- | Show a duplicate union type field names error as a string duplicateUnionTypeFieldNamesError :: ErrorCore.DuplicateUnionTypeFieldNamesError -> String duplicateUnionTypeFieldNamesError e =- Strings.cat [+ Strings.concat [ "duplicate field in union type: ", (Core.unName (ErrorCore.duplicateUnionTypeFieldNamesErrorName e))] -- | Show an empty case statement error as a string emptyCaseStatementError :: ErrorCore.EmptyCaseStatementError -> String emptyCaseStatementError e =- Strings.cat [+ Strings.concat [ "empty case statement for type: ", (Core.unName (ErrorCore.emptyCaseStatementErrorTypeName e))] @@ -110,28 +110,28 @@ -- | Show an invalid forall parameter name error as a string invalidForallParameterNameError :: ErrorCore.InvalidForallParameterNameError -> String invalidForallParameterNameError e =- Strings.cat [+ Strings.concat [ "invalid forall parameter name: ", (Core.unName (ErrorCore.invalidForallParameterNameErrorName e))] -- | Show an invalid lambda parameter name error as a string invalidLambdaParameterNameError :: ErrorCore.InvalidLambdaParameterNameError -> String invalidLambdaParameterNameError e =- Strings.cat [+ Strings.concat [ "invalid lambda parameter name: ", (Core.unName (ErrorCore.invalidLambdaParameterNameErrorName e))] -- | Show an invalid let binding name error as a string invalidLetBindingNameError :: ErrorCore.InvalidLetBindingNameError -> String invalidLetBindingNameError e =- Strings.cat [+ Strings.concat [ "invalid let binding name: ", (Core.unName (ErrorCore.invalidLetBindingNameErrorName e))] -- | Show an invalid term error as a string invalidTermError :: ErrorCore.InvalidTermError -> String invalidTermError e =- Strings.cat2 "invalid term: " (case e of+ Strings.concat2 "invalid term: " (case e of ErrorCore.InvalidTermErrorConstantCondition v0 -> constantConditionError v0 ErrorCore.InvalidTermErrorDuplicateBinding v0 -> duplicateBindingError v0 ErrorCore.InvalidTermErrorDuplicateField v0 -> duplicateFieldError v0@@ -160,7 +160,7 @@ -- | Show an invalid type error as a string invalidTypeError :: ErrorCore.InvalidTypeError -> String invalidTypeError e =- Strings.cat2 "invalid type: " (case e of+ Strings.concat2 "invalid type: " (case e of ErrorCore.InvalidTypeErrorDuplicateRecordTypeFieldNames v0 -> duplicateRecordTypeFieldNamesError v0 ErrorCore.InvalidTypeErrorDuplicateUnionTypeFieldNames v0 -> duplicateUnionTypeFieldNamesError v0 ErrorCore.InvalidTypeErrorEmptyRecordType v0 -> emptyRecordTypeError v0@@ -179,14 +179,14 @@ -- | Show an invalid type lambda parameter name error as a string invalidTypeLambdaParameterNameError :: ErrorCore.InvalidTypeLambdaParameterNameError -> String invalidTypeLambdaParameterNameError e =- Strings.cat [+ Strings.concat [ "invalid type lambda parameter name: ", (Core.unName (ErrorCore.invalidTypeLambdaParameterNameErrorName e))] -- | Show an invalid type scheme variable name error as a string invalidTypeSchemeVariableNameError :: ErrorCore.InvalidTypeSchemeVariableNameError -> String invalidTypeSchemeVariableNameError e =- Strings.cat [+ Strings.concat [ "invalid type scheme variable name: ", (Core.unName (ErrorCore.invalidTypeSchemeVariableNameErrorName e))] @@ -196,11 +196,11 @@ let tname = ErrorCore.missingCaseBranchesErrorTypeName e variantNames = ErrorCore.missingCaseBranchesErrorVariantNames e- in (Strings.cat [+ in (Strings.concat [ "case statement for type ", (Core.unName tname), " does not cover variant(s): ",- (Strings.intercalate ", " (Lists.map Core.unName variantNames))])+ (Strings.join ", " (Lists.map Core.unName variantNames))]) -- | Show a nested term annotation error as a string nestedTermAnnotationError :: t0 -> String@@ -213,56 +213,56 @@ -- | Show a non-comparable map key type error as a string nonComparableMapKeyTypeError :: ErrorCore.NonComparableMapKeyTypeError -> String nonComparableMapKeyTypeError e =- Strings.cat [+ Strings.concat [ "map key type contains a function type: ", (PrintCore.type_ (ErrorCore.nonComparableMapKeyTypeErrorKeyType e))] -- | Show a non-comparable set element type error as a string nonComparableSetElementTypeError :: ErrorCore.NonComparableSetElementTypeError -> String nonComparableSetElementTypeError e =- Strings.cat [+ Strings.concat [ "set element type contains a function type: ", (PrintCore.type_ (ErrorCore.nonComparableSetElementTypeErrorElementType e))] -- | Show a redundant wrap/unwrap error as a string redundantWrapUnwrapError :: ErrorCore.RedundantWrapUnwrapError -> String redundantWrapUnwrapError e =- Strings.cat [+ Strings.concat [ "redundant wrap/unwrap for type: ", (Core.unName (ErrorCore.redundantWrapUnwrapErrorTypeName e))] -- | Show a self-application error as a string selfApplicationError :: ErrorCore.SelfApplicationError -> String selfApplicationError e =- Strings.cat [+ Strings.concat [ "self-application of variable: ", (Core.unName (ErrorCore.selfApplicationErrorName e))] -- | Show a single variant union error as a string singleVariantUnionError :: ErrorCore.SingleVariantUnionError -> String singleVariantUnionError e =- Strings.cat [+ Strings.concat [ "union type with single variant: ", (Core.unName (ErrorCore.singleVariantUnionErrorFieldName e))] -- | Show a term variable shadowing error as a string termVariableShadowingError :: ErrorCore.TermVariableShadowingError -> String termVariableShadowingError e =- Strings.cat [+ Strings.concat [ "variable shadowing: ", (Core.unName (ErrorCore.termVariableShadowingErrorName e))] -- | Show a type variable shadowing in forall error as a string typeVariableShadowingInForallError :: ErrorCore.TypeVariableShadowingInForallError -> String typeVariableShadowingInForallError e =- Strings.cat [+ Strings.concat [ "type variable shadowing in forall: ", (Core.unName (ErrorCore.typeVariableShadowingInForallErrorName e))] -- | Show a type variable shadowing in type lambda error as a string typeVariableShadowingInTypeLambdaError :: ErrorCore.TypeVariableShadowingInTypeLambdaError -> String typeVariableShadowingInTypeLambdaError e =- Strings.cat [+ Strings.concat [ "type variable shadowing in type lambda: ", (Core.unName (ErrorCore.typeVariableShadowingInTypeLambdaErrorName e))] @@ -272,7 +272,7 @@ let fname = ErrorCore.undefinedFieldErrorFieldName e tname = ErrorCore.undefinedFieldErrorTypeName e- in (Strings.cat [+ in (Strings.concat [ "no such field \"", (Core.unName fname), "\" in type \"",@@ -282,35 +282,35 @@ -- | Show an undefined term variable error as a string undefinedTermVariableError :: ErrorCore.UndefinedTermVariableError -> String undefinedTermVariableError e =- Strings.cat [+ Strings.concat [ "undefined term variable: ", (Core.unName (ErrorCore.undefinedTermVariableErrorName e))] -- | Show an undefined type variable error as a string undefinedTypeVariableError :: ErrorCore.UndefinedTypeVariableError -> String undefinedTypeVariableError e =- Strings.cat [+ Strings.concat [ "undefined type variable: ", (Core.unName (ErrorCore.undefinedTypeVariableErrorName e))] -- | Show an undefined type variable in binding type error as a string undefinedTypeVariableInBindingTypeError :: ErrorCore.UndefinedTypeVariableInBindingTypeError -> String undefinedTypeVariableInBindingTypeError e =- Strings.cat [+ Strings.concat [ "undefined type variable in binding type: ", (Core.unName (ErrorCore.undefinedTypeVariableInBindingTypeErrorName e))] -- | Show an undefined type variable in lambda domain error as a string undefinedTypeVariableInLambdaDomainError :: ErrorCore.UndefinedTypeVariableInLambdaDomainError -> String undefinedTypeVariableInLambdaDomainError e =- Strings.cat [+ Strings.concat [ "undefined type variable in lambda domain: ", (Core.unName (ErrorCore.undefinedTypeVariableInLambdaDomainErrorName e))] -- | Show an undefined type variable in type application error as a string undefinedTypeVariableInTypeApplicationError :: ErrorCore.UndefinedTypeVariableInTypeApplicationError -> String undefinedTypeVariableInTypeApplicationError e =- Strings.cat [+ Strings.concat [ "undefined type variable in type application: ", (Core.unName (ErrorCore.undefinedTypeVariableInTypeApplicationErrorName e))] @@ -320,7 +320,7 @@ let expected = ErrorCore.unexpectedTermVariantErrorExpectedVariant e actual = ErrorCore.unexpectedTermVariantErrorActualTerm e- in (Strings.cat [+ in (Strings.concat [ "expected ", (PrintVariants.termVariant expected), " term but found ",@@ -332,7 +332,7 @@ let expected = ErrorCore.unexpectedTypeVariantErrorExpectedVariant e actual = ErrorCore.unexpectedTypeVariantErrorActualType e- in (Strings.cat [+ in (Strings.concat [ "expected ", (PrintVariants.typeVariant expected), " type but found ",@@ -344,7 +344,7 @@ let tname = ErrorCore.unknownCaseAlternativeErrorTypeName e name = ErrorCore.unknownCaseAlternativeErrorName e- in (Strings.cat [+ in (Strings.concat [ "case alternative ", (Core.unName name), " is not a variant of type ",@@ -353,7 +353,7 @@ -- | Show an unknown primitive name error as a string unknownPrimitiveNameError :: ErrorCore.UnknownPrimitiveNameError -> String unknownPrimitiveNameError e =- Strings.cat [+ Strings.concat [ "unknown primitive: ", (Core.unName (ErrorCore.unknownPrimitiveNameErrorName e))] @@ -364,7 +364,7 @@ -- | Show an untyped term variable error as a string untypedTermVariableError :: ErrorCore.UntypedTermVariableError -> String untypedTermVariableError e =- Strings.cat [+ Strings.concat [ "untyped term variable: ", (Core.unName (ErrorCore.untypedTermVariableErrorName e))]
src/main/haskell/Hydra/Print/Error/Packaging.hs view
@@ -41,7 +41,7 @@ -- | Show a conflicting module namespace error as a string conflictingModuleNameError :: ErrorPackaging.ConflictingModuleNameError -> String conflictingModuleNameError e =- Strings.cat [+ Strings.concat [ "module namespaces conflict when mapped to target language path: ", (Packaging.unModuleName (ErrorPackaging.conflictingModuleNameErrorFirst e)), " vs ",@@ -50,7 +50,7 @@ -- | Show a conflicting variant name error as a string conflictingVariantNameError :: ErrorPackaging.ConflictingVariantNameError -> String conflictingVariantNameError e =- Strings.cat [+ Strings.concat [ "in module ", (Packaging.unModuleName (ErrorPackaging.conflictingVariantNameErrorModuleName e)), ": variant ",@@ -64,7 +64,7 @@ -- | Show a definition-not-in-module-namespace error as a string definitionNotInModuleNameError :: ErrorPackaging.DefinitionNotInModuleNameError -> String definitionNotInModuleNameError e =- Strings.cat [+ Strings.concat [ "definition ", (Core.unName (ErrorPackaging.definitionNotInModuleNameErrorName e)), " is not in module namespace ",@@ -73,7 +73,7 @@ -- | Show a definitions-out-of-order error as a string definitionsOutOfOrderError :: ErrorPackaging.DefinitionsOutOfOrderError -> String definitionsOutOfOrderError e =- Strings.cat [+ Strings.concat [ "in module ", (Packaging.unModuleName (ErrorPackaging.definitionsOutOfOrderErrorModuleName e)), ": definitions out of order: ",@@ -84,7 +84,7 @@ -- | Show a duplicate definition name error as a string duplicateDefinitionNameError :: ErrorPackaging.DuplicateDefinitionNameError -> String duplicateDefinitionNameError e =- Strings.cat [+ Strings.concat [ "in module ", (Packaging.unModuleName (ErrorPackaging.duplicateDefinitionNameErrorModuleName e)), ": duplicate definition name ",@@ -93,14 +93,14 @@ -- | Show a duplicate module namespace error as a string duplicateModuleNameError :: ErrorPackaging.DuplicateModuleNameError -> String duplicateModuleNameError e =- Strings.cat [+ Strings.concat [ "duplicate module namespace ", (Packaging.unModuleName (ErrorPackaging.duplicateModuleNameErrorModuleName e))] -- | Show an invalid definition name error as a string invalidDefinitionNameError :: ErrorPackaging.InvalidDefinitionNameError -> String invalidDefinitionNameError e =- Strings.cat [+ Strings.concat [ "in module ", (Packaging.unModuleName (ErrorPackaging.invalidDefinitionNameErrorModuleName e)), ": definition ",@@ -111,7 +111,7 @@ -- | Show an invalid module error as a string invalidModuleError :: ErrorPackaging.InvalidModuleError -> String invalidModuleError e =- Strings.cat2 "invalid module: " (case e of+ Strings.concat2 "invalid module: " (case e of ErrorPackaging.InvalidModuleErrorConflictingVariantName v0 -> conflictingVariantNameError v0 ErrorPackaging.InvalidModuleErrorDefinitionNotInModuleName v0 -> definitionNotInModuleNameError v0 ErrorPackaging.InvalidModuleErrorDefinitionsOutOfOrder v0 -> definitionsOutOfOrderError v0@@ -123,7 +123,7 @@ -- | Show an invalid namespace convention error as a string invalidModuleNameConventionError :: ErrorPackaging.InvalidModuleNameConventionError -> String invalidModuleNameConventionError e =- Strings.cat [+ Strings.concat [ "namespace ", (Packaging.unModuleName (ErrorPackaging.invalidModuleNameConventionErrorModuleName e)), " does not match the dotted-camelCase naming convention"]@@ -131,7 +131,7 @@ -- | Show an invalid package error as a string invalidPackageError :: ErrorPackaging.InvalidPackageError -> String invalidPackageError e =- Strings.cat2 "invalid package: " (case e of+ Strings.concat2 "invalid package: " (case e of ErrorPackaging.InvalidPackageErrorConflictingModuleName v0 -> conflictingModuleNameError v0 ErrorPackaging.InvalidPackageErrorDuplicateModuleName v0 -> duplicateModuleNameError v0 ErrorPackaging.InvalidPackageErrorInvalidModule v0 -> invalidModuleError v0@@ -141,7 +141,7 @@ -- | Show an invalid package name error as a string invalidPackageNameError :: ErrorPackaging.InvalidPackageNameError -> String invalidPackageNameError e =- Strings.cat [+ Strings.concat [ "package name ", (Packaging.unPackageName (ErrorPackaging.invalidPackageNameErrorPackageName e)), " does not match the hyphen-separated lowercase naming convention"]@@ -149,7 +149,7 @@ -- | Show a missing documentation error as a string missingDocumentationError :: ErrorPackaging.MissingDocumentationError -> String missingDocumentationError e =- Strings.cat [+ Strings.concat [ "in module ", (Packaging.unModuleName (ErrorPackaging.missingDocumentationErrorModuleName e)), ": definition ",@@ -159,7 +159,7 @@ -- | Show an undeclared dependency error as a string undeclaredDependencyError :: ErrorPackaging.UndeclaredDependencyError -> String undeclaredDependencyError e =- Strings.cat [+ Strings.concat [ "module ", (Packaging.unModuleName (ErrorPackaging.undeclaredDependencyErrorModuleName e)), " references ",
src/main/haskell/Hydra/Print/Errors.hs view
@@ -62,7 +62,7 @@ -- | Show a decoding error as a string decodingError :: Errors.DecodingError -> String-decodingError de = Strings.cat2 "decoding error: " (Errors.unDecodingError de)+decodingError de = Strings.concat2 "decoding error: " (Errors.unDecodingError de) -- | Show an error as a string error :: Errors.Error -> String@@ -88,7 +88,7 @@ incorrectUnificationError e = let subst = Checking.incorrectUnificationErrorSubstitution e- in (Strings.cat2 "incorrect unification: " (PrintTyping.typeSubst subst))+ in (Strings.concat2 "incorrect unification: " (PrintTyping.typeSubst subst)) -- | Show a not-a-forall-type error as a string notAForallTypeError :: Checking.NotAForallTypeError -> String@@ -96,7 +96,7 @@ let typ = Checking.notAForallTypeErrorType e args = Checking.notAForallTypeErrorTypeArguments e- in (Strings.cat [+ in (Strings.concat [ "not a forall type: ", (PrintCore.type_ typ), ". Trying to apply ",@@ -109,7 +109,7 @@ notAFunctionTypeError e = let typ = Checking.notAFunctionTypeErrorType e- in (Strings.cat2 "not a function type: " (PrintCore.type_ typ))+ in (Strings.concat2 "not a function type: " (PrintCore.type_ typ)) -- | Show an other error as a string otherError :: Errors.OtherError -> String@@ -119,11 +119,11 @@ resolutionError :: Errors.ResolutionError -> String resolutionError re = case re of- Errors.ResolutionErrorNoSuchBinding v0 -> Strings.cat2 "no such binding: " (Core.unName (Errors.noSuchBindingErrorName v0))- Errors.ResolutionErrorNoSuchPrimitive v0 -> Strings.cat2 "no such primitive: " (Core.unName (Errors.noSuchPrimitiveErrorName v0))- Errors.ResolutionErrorNoMatchingField v0 -> Strings.cat2 "no matching field: " (Core.unName (Errors.noMatchingFieldErrorFieldName v0))- Errors.ResolutionErrorOther v0 -> Strings.cat2 "resolution error: " (Errors.unOtherResolutionError v0)- Errors.ResolutionErrorUnexpectedShape v0 -> Strings.cat [+ Errors.ResolutionErrorNoSuchBinding v0 -> Strings.concat2 "no such binding: " (Core.unName (Errors.noSuchBindingErrorName v0))+ Errors.ResolutionErrorNoSuchPrimitive v0 -> Strings.concat2 "no such primitive: " (Core.unName (Errors.noSuchPrimitiveErrorName v0))+ Errors.ResolutionErrorNoMatchingField v0 -> Strings.concat2 "no matching field: " (Core.unName (Errors.noMatchingFieldErrorFieldName v0))+ Errors.ResolutionErrorOther v0 -> Strings.concat2 "resolution error: " (Errors.unOtherResolutionError v0)+ Errors.ResolutionErrorUnexpectedShape v0 -> Strings.concat [ "unexpected shape: expected ", (Errors.unexpectedShapeErrorExpected v0), " but got ",@@ -137,7 +137,7 @@ expected = Checking.typeArityMismatchErrorExpectedArity e actual = Checking.typeArityMismatchErrorActualArity e args = Checking.typeArityMismatchErrorTypeArguments e- in (Strings.cat [+ in (Strings.concat [ "type ", (PrintCore.type_ typ), " applied to the wrong number of type arguments (expected ",@@ -153,7 +153,7 @@ let expected = Checking.typeMismatchErrorExpectedType e actual = Checking.typeMismatchErrorActualType e- in (Strings.cat [+ in (Strings.concat [ "type mismatch: expected ", (PrintCore.type_ expected), " but found ",@@ -165,9 +165,9 @@ let vars = Checking.unboundTypeVariablesErrorVariables e typ = Checking.unboundTypeVariablesErrorType e- in (Strings.cat [+ in (Strings.concat [ "unbound type variables: {",- (Strings.intercalate ", " (Lists.map Core.unName (Sets.toList vars))),+ (Strings.join ", " (Lists.map Core.unName (Sets.toList vars))), "} in type ", (PrintCore.type_ typ)]) @@ -177,7 +177,7 @@ let types = Checking.unequalTypesErrorTypes e desc = Checking.unequalTypesErrorDescription e- in (Strings.cat [+ in (Strings.concat [ "unequal types ", (Formatting.showList PrintCore.type_ types), " in ",@@ -190,7 +190,7 @@ let lt = Errors.unificationErrorLeftType e rt = Errors.unificationErrorRightType e msg = Errors.unificationErrorMessage e- in (Strings.cat [+ in (Strings.concat [ "unification error: cannot unify ", (PrintCore.type_ lt), " with ",@@ -201,7 +201,7 @@ -- | Show an unsupported term variant error as a string unsupportedTermVariantError :: Checking.UnsupportedTermVariantError -> String unsupportedTermVariantError e =- Strings.cat2 "unsupported term variant: " (PrintVariants.termVariant (Checking.unsupportedTermVariantErrorTermVariant e))+ Strings.concat2 "unsupported term variant: " (PrintVariants.termVariant (Checking.unsupportedTermVariantErrorTermVariant e)) -- | Show an untyped lambda error as a string untypedLambdaError :: t0 -> String@@ -212,4 +212,4 @@ untypedLetBindingError e = let b = Checking.untypedLetBindingErrorBinding e- in (Strings.cat2 "untyped let binding: " (PrintCore.binding b))+ in (Strings.concat2 "untyped let binding: " (PrintCore.binding b))
src/main/haskell/Hydra/Print/Graph.hs view
@@ -44,7 +44,7 @@ graph elements = let elementStrs = Lists.map PrintCore.binding elements- in (Strings.cat [+ in (Strings.concat [ "{",- (Strings.intercalate ", " elementStrs),+ (Strings.join ", " elementStrs), "}"])
src/main/haskell/Hydra/Print/Paths.hs view
@@ -50,22 +50,22 @@ subtermStep step = let idx = \i -> Nothing- idxSuff = \suffix -> \i -> Optionals.map (\s -> Strings.cat2 s suffix) (idx i)+ 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.cat2 "." (Core.unName v0))+ Paths.SubtermStepUnionCasesBranch v0 -> Just (Strings.concat2 "." (Core.unName v0)) Paths.SubtermStepLetBody -> Just "in"- Paths.SubtermStepLetBinding v0 -> Just (Strings.cat2 (Core.unName v0) "=")+ 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.cat2 "." (Core.unName v0))+ Paths.SubtermStepRecordField v0 -> Just (Strings.concat2 "." (Core.unName v0)) Paths.SubtermStepSetElement v0 -> idx v0 Paths.SubtermStepSumTerm -> Nothing Paths.SubtermStepTypeLambdaBody -> Nothing
src/main/haskell/Hydra/Print/Pcre/Regex.hs view
@@ -43,7 +43,7 @@ -- | Render an alternation, joining its branches with the | operator. alternation :: [[Regex.Quantified]] -> String-alternation alt = Strings.intercalate "|" (Lists.map regexSequence alt)+alternation alt = Strings.join "|" (Lists.map regexSequence alt) -- | Render a single atom; the . metacharacter renders as [\s\S] to preserve newline-inclusive 'any'. atom :: Regex.Atom -> String@@ -53,7 +53,7 @@ Regex.AtomAny -> "[\\s\\S]" Regex.AtomAnchorStart -> "^" Regex.AtomAnchorEnd -> "$"- Regex.AtomGroup v0 -> Strings.cat [+ Regex.AtomGroup v0 -> Strings.concat [ "(", (alternation v0), ")"]@@ -62,10 +62,10 @@ -- | Render a character class, including the leading ^ for a negated class. characterClass :: Regex.CharacterClass -> String characterClass cc =- Strings.cat [+ Strings.concat [ "[", (Logic.ifElse (Regex.characterClassNegated cc) "^" ""),- (Strings.cat (Lists.map classItem (Regex.characterClassItems cc))),+ (Strings.concat (Lists.map classItem (Regex.characterClassItems cc))), "]"] -- | Render one character-class member (a single character or an inclusive range).@@ -73,7 +73,7 @@ classItem item = case item of Regex.ClassItemCharacter v0 -> escapeClassChar v0- Regex.ClassItemRange v0 -> Strings.cat [+ Regex.ClassItemRange v0 -> Strings.concat [ escapeClassChar (Regex.characterRangeFrom v0), "-", (escapeClassChar (Regex.characterRangeTo v0))]@@ -88,7 +88,7 @@ 93, 94, 45]- in (Logic.ifElse isMeta (Strings.cat2 "\\" (showCodePoint c)) (showCodePoint c))+ in (Logic.ifElse isMeta (Strings.concat2 "\\" (showCodePoint c)) (showCodePoint c)) -- | Render a literal code point in top-level context, backslash-escaping PCRE/ECMA metacharacters. escapeLiteral :: Int -> String@@ -110,7 +110,7 @@ 125, 124, 92]- in (Logic.ifElse isMeta (Strings.cat2 "\\" (showCodePoint c)) (showCodePoint c))+ in (Logic.ifElse isMeta (Strings.concat2 "\\" (showCodePoint c)) (showCodePoint 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@@ -118,7 +118,7 @@ -- | Render an atom followed by its quantifier suffix. quantified :: Regex.Quantified -> String-quantified qa = Strings.cat2 (atom (Regex.quantifiedAtom qa)) (quantifier (Regex.quantifiedQuantifier qa))+quantified qa = Strings.concat2 (atom (Regex.quantifiedAtom qa)) (quantifier (Regex.quantifiedQuantifier qa)) -- | Render a quantifier suffix; the 'one' quantifier renders as the empty string. quantifier :: Regex.Quantifier -> String@@ -128,15 +128,15 @@ Regex.QuantifierZeroOrOne -> "?" Regex.QuantifierZeroOrMore -> "*" Regex.QuantifierOneOrMore -> "+"- Regex.QuantifierExactly v0 -> Strings.cat [+ Regex.QuantifierExactly v0 -> Strings.concat [ "{", (Literals.showInt32 v0), "}"]- Regex.QuantifierAtLeast v0 -> Strings.cat [+ Regex.QuantifierAtLeast v0 -> Strings.concat [ "{", (Literals.showInt32 v0), ",}"]- Regex.QuantifierRange_ v0 -> Strings.cat [+ Regex.QuantifierRange_ v0 -> Strings.concat [ "{", (Literals.showInt32 (Regex.quantifierRangeMin v0)), ",",@@ -145,7 +145,7 @@ -- | Render a sequence of quantified atoms by concatenation. regexSequence :: [Regex.Quantified] -> String-regexSequence s = Strings.cat (Lists.map quantified s)+regexSequence s = Strings.concat (Lists.map quantified s) -- | Render a single Unicode code point as a one-character string. showCodePoint :: Int -> String
src/main/haskell/Hydra/Print/Posix/Regex.hs view
@@ -43,12 +43,12 @@ -- | Render an alternation, joining its branches with the | operator. alternation :: [[Regex.Quantified]] -> String-alternation alt = Strings.intercalate "|" (Lists.map regexSequence alt)+alternation alt = Strings.join "|" (Lists.map regexSequence alt) -- | The POSIX ERE rendering of Hydra's . (any character incl. newline): an explicit character-class range spanning the whole Unicode scalar range, which POSIX ERE engines match literally. anyClass :: String anyClass =- Strings.cat [+ Strings.concat [ "[", (showCodePoint 0), "-",@@ -63,7 +63,7 @@ Regex.AtomAny -> anyClass Regex.AtomAnchorStart -> "^" Regex.AtomAnchorEnd -> "$"- Regex.AtomGroup v0 -> Strings.cat [+ Regex.AtomGroup v0 -> Strings.concat [ "(", (alternation v0), ")"]@@ -72,10 +72,10 @@ -- | Render a character class, including the leading ^ for a negated class. characterClass :: Regex.CharacterClass -> String characterClass cc =- Strings.cat [+ Strings.concat [ "[", (Logic.ifElse (Regex.characterClassNegated cc) "^" ""),- (Strings.cat (Lists.map classItem (Regex.characterClassItems cc))),+ (Strings.concat (Lists.map classItem (Regex.characterClassItems cc))), "]"] -- | Render one character-class member (a single character or an inclusive range).@@ -83,7 +83,7 @@ classItem item = case item of Regex.ClassItemCharacter v0 -> escapeClassChar v0- Regex.ClassItemRange v0 -> Strings.cat [+ Regex.ClassItemRange v0 -> Strings.concat [ escapeClassChar (Regex.characterRangeFrom v0), "-", (escapeClassChar (Regex.characterRangeTo v0))]@@ -98,7 +98,7 @@ 93, 94, 45]- in (Logic.ifElse isMeta (Strings.cat2 "\\" (showCodePoint c)) (showCodePoint c))+ in (Logic.ifElse isMeta (Strings.concat2 "\\" (showCodePoint c)) (showCodePoint c)) -- | Render a literal code point in top-level context, backslash-escaping POSIX ERE metacharacters. escapeLiteral :: Int -> String@@ -120,7 +120,7 @@ 125, 124, 92]- in (Logic.ifElse isMeta (Strings.cat2 "\\" (showCodePoint c)) (showCodePoint c))+ in (Logic.ifElse isMeta (Strings.concat2 "\\" (showCodePoint c)) (showCodePoint 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@@ -128,7 +128,7 @@ -- | Render an atom followed by its quantifier suffix. quantified :: Regex.Quantified -> String-quantified qa = Strings.cat2 (atom (Regex.quantifiedAtom qa)) (quantifier (Regex.quantifiedQuantifier qa))+quantified qa = Strings.concat2 (atom (Regex.quantifiedAtom qa)) (quantifier (Regex.quantifiedQuantifier qa)) -- | Render a quantifier suffix; the 'one' quantifier renders as the empty string. quantifier :: Regex.Quantifier -> String@@ -138,15 +138,15 @@ Regex.QuantifierZeroOrOne -> "?" Regex.QuantifierZeroOrMore -> "*" Regex.QuantifierOneOrMore -> "+"- Regex.QuantifierExactly v0 -> Strings.cat [+ Regex.QuantifierExactly v0 -> Strings.concat [ "{", (Literals.showInt32 v0), "}"]- Regex.QuantifierAtLeast v0 -> Strings.cat [+ Regex.QuantifierAtLeast v0 -> Strings.concat [ "{", (Literals.showInt32 v0), ",}"]- Regex.QuantifierRange_ v0 -> Strings.cat [+ Regex.QuantifierRange_ v0 -> Strings.concat [ "{", (Literals.showInt32 (Regex.quantifierRangeMin v0)), ",",@@ -155,7 +155,7 @@ -- | Render a sequence of quantified atoms by concatenation. regexSequence :: [Regex.Quantified] -> String-regexSequence s = Strings.cat (Lists.map quantified s)+regexSequence s = Strings.concat (Lists.map quantified s) -- | Render a single Unicode code point as a one-character string. showCodePoint :: Int -> String
src/main/haskell/Hydra/Print/Regex.hs view
@@ -43,7 +43,7 @@ -- | Render an alternation, joining its branches with the | operator. alternation :: [[Regex.Quantified]] -> String-alternation alt = Strings.intercalate "|" (Lists.map regexSequence alt)+alternation alt = Strings.join "|" (Lists.map regexSequence alt) -- | Render a single atom (literal, ., anchor, group, or class) to canonical text. atom :: Regex.Atom -> String@@ -53,7 +53,7 @@ Regex.AtomAny -> "." Regex.AtomAnchorStart -> "^" Regex.AtomAnchorEnd -> "$"- Regex.AtomGroup v0 -> Strings.cat [+ Regex.AtomGroup v0 -> Strings.concat [ "(", (alternation v0), ")"]@@ -62,10 +62,10 @@ -- | Render a character class, including the leading ^ for a negated class. characterClass :: Regex.CharacterClass -> String characterClass cc =- Strings.cat [+ Strings.concat [ "[", (Logic.ifElse (Regex.characterClassNegated cc) "^" ""),- (Strings.cat (Lists.map classItem (Regex.characterClassItems cc))),+ (Strings.concat (Lists.map classItem (Regex.characterClassItems cc))), "]"] -- | Render one character-class member (a single character or an inclusive range) to canonical text.@@ -73,7 +73,7 @@ classItem item = case item of Regex.ClassItemCharacter v0 -> escapeClassChar v0- Regex.ClassItemRange v0 -> Strings.cat [+ Regex.ClassItemRange v0 -> Strings.concat [ escapeClassChar (Regex.characterRangeFrom v0), "-", (escapeClassChar (Regex.characterRangeTo v0))]@@ -88,7 +88,7 @@ 93, 94, 45]- in (Logic.ifElse isMeta (Strings.cat2 "\\" (showCodePoint c)) (showCodePoint c))+ in (Logic.ifElse isMeta (Strings.concat2 "\\" (showCodePoint c)) (showCodePoint 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,7 +110,7 @@ 125, 124, 92]- in (Logic.ifElse isMeta (Strings.cat2 "\\" (showCodePoint c)) (showCodePoint c))+ in (Logic.ifElse isMeta (Strings.concat2 "\\" (showCodePoint c)) (showCodePoint 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@@ -118,7 +118,7 @@ -- | Render an atom followed by its quantifier suffix. quantified :: Regex.Quantified -> String-quantified qa = Strings.cat2 (atom (Regex.quantifiedAtom qa)) (quantifier (Regex.quantifiedQuantifier qa))+quantified qa = Strings.concat2 (atom (Regex.quantifiedAtom qa)) (quantifier (Regex.quantifiedQuantifier qa)) -- | Render a quantifier suffix; the 'one' quantifier renders as the empty string. quantifier :: Regex.Quantifier -> String@@ -128,15 +128,15 @@ Regex.QuantifierZeroOrOne -> "?" Regex.QuantifierZeroOrMore -> "*" Regex.QuantifierOneOrMore -> "+"- Regex.QuantifierExactly v0 -> Strings.cat [+ Regex.QuantifierExactly v0 -> Strings.concat [ "{", (Literals.showInt32 v0), "}"]- Regex.QuantifierAtLeast v0 -> Strings.cat [+ Regex.QuantifierAtLeast v0 -> Strings.concat [ "{", (Literals.showInt32 v0), ",}"]- Regex.QuantifierRange_ v0 -> Strings.cat [+ Regex.QuantifierRange_ v0 -> Strings.concat [ "{", (Literals.showInt32 (Regex.quantifierRangeMin v0)), ",",@@ -145,7 +145,7 @@ -- | Render a sequence of quantified atoms by concatenation. regexSequence :: [Regex.Quantified] -> String-regexSequence s = Strings.cat (Lists.map quantified s)+regexSequence s = Strings.concat (Lists.map quantified s) -- | Render a single Unicode code point as a one-character string. showCodePoint :: Int -> String
src/main/haskell/Hydra/Print/Typing.hs view
@@ -47,7 +47,7 @@ let ltyp = Typing.typeConstraintLeft tc rtyp = Typing.typeConstraintRight tc- in (Strings.cat [+ in (Strings.concat [ PrintCore.type_ ltyp, "\8801", (PrintCore.type_ rtyp)])@@ -62,12 +62,12 @@ \pair -> let name = Core.unName (Pairs.first pair) typ = Pairs.second pair- in (Strings.cat [+ in (Strings.concat [ name, "\8614", (PrintCore.type_ typ)]) pairStrs = Lists.map showPair pairs- in (Strings.cat [+ in (Strings.concat [ "{",- (Strings.intercalate "," pairStrs),+ (Strings.join "," pairStrs), "}"])
src/main/haskell/Hydra/Reduction.hs view
@@ -33,6 +33,7 @@ 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+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@@ -143,14 +144,14 @@ Core.TermVariable v0 -> Optionals.cases (Optionals.map Scoping.typeSchemeToFType (Maps.lookup v0 (Graph.graphBoundTypes tx))) (Optionals.cases (Maps.lookup v0 primTypes) 0 Arity.typeSchemeArity) Arity.typeArity _ -> 0 domainTypes =- \n -> \mt -> Logic.ifElse (Equality.lte n 0) [] (Optionals.cases mt (Lists.map (\_ -> Nothing) (Math.range 1 n)) (\typ -> case typ of+ \n -> \mt -> Logic.ifElse (Ordering.lte n 0) [] (Optionals.cases mt (Lists.map (\_ -> Nothing) (Math.range 1 n)) (\typ -> case typ of Core.TypeFunction v0 -> Lists.cons (Just (Core.functionTypeDomain v0)) (domainTypes (Math.sub n 1) (Just (Core.functionTypeCodomain v0))) Core.TypeAnnotated v0 -> domainTypes n (Just (Core.annotatedTypeBody v0)) Core.TypeApplication v0 -> domainTypes n (Just (Core.applicationTypeFunction v0)) Core.TypeForall _ -> Lists.map (\_2 -> Nothing) (Math.range 1 n) _ -> Lists.map (\_ -> Nothing) (Math.range 1 n))) peelFunctionDomains =- \mtyp -> \n -> Logic.ifElse (Equality.lte n 0) mtyp (Optionals.cases mtyp Nothing (\typ -> case typ of+ \mtyp -> \n -> Logic.ifElse (Ordering.lte n 0) mtyp (Optionals.cases mtyp Nothing (\typ -> case typ of Core.TypeFunction v0 -> peelFunctionDomains (Just (Core.functionTypeCodomain v0)) (Math.sub n 1) Core.TypeAnnotated v0 -> peelFunctionDomains (Just (Core.annotatedTypeBody v0)) n Core.TypeApplication v0 -> peelFunctionDomains (Just (Core.applicationTypeFunction v0)) n@@ -164,14 +165,14 @@ Core.applicationArgument = arg})) head args numArgs = Lists.length args needed = Math.sub arity numArgs- in (Logic.ifElse (Logic.and (Equality.gt needed 0) (Logic.or alwaysPad (Equality.gt numArgs 0))) (+ in (Logic.ifElse (Logic.and (Ordering.gt needed 0) (Logic.or alwaysPad (Ordering.gt numArgs 0))) ( let indices = Math.range 1 needed remainingType = peelFunctionDomains headTyp numArgs domains = domainTypes needed remainingType codomainType = peelFunctionDomains remainingType needed fullyAppliedRaw = Lists.foldl (\body -> \i ->- let vn = Core.Name (Strings.cat2 "v" (Literals.showInt32 i))+ let vn = Core.Name (Strings.concat2 "v" (Literals.showInt32 i)) in (Core.TermApplication (Core.Application { Core.applicationFunction = body, Core.applicationArgument = (Core.TermVariable vn)}))) applied indices@@ -183,7 +184,7 @@ in (Lists.foldl (\body -> \idPair -> let i = Pairs.first idPair dom = Pairs.second idPair- vn = Core.Name (Strings.cat2 "v" (Literals.showInt32 i))+ vn = Core.Name (Strings.concat2 "v" (Literals.showInt32 i)) in (Core.TermLambda (Core.Lambda { Core.lambdaParameter = vn, Core.lambdaDomain = dom,@@ -372,7 +373,7 @@ in (arityOf txt (Core.typeLambdaBody v0)) Core.TermVariable v0 -> Optionals.cases (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.cat2 "v" (Literals.showInt32 i))) (Math.range 1 n)+ extraVariables = \n -> Lists.map (\i -> Core.Name (Strings.concat2 "v" (Literals.showInt32 i))) (Math.range 1 n) pad = \vars -> \body -> Optionals.cases (Lists.uncons vars) body (\uc -> let v0 = Pairs.first uc@@ -421,7 +422,7 @@ Core.TermApplication (Core.Application { Core.applicationFunction = lhs2, Core.applicationArgument = rhs2})- in (Right (Logic.ifElse (Equality.gt lhsarity 1) (padn (Math.sub lhsarity 1) a2) a2))))))+ in (Right (Logic.ifElse (Ordering.gt lhsarity 1) (padn (Math.sub lhsarity 1) a2) a2)))))) Core.TermCases v0 -> forCases v0 Core.TermProject v0 -> Right (forNullaryElim (Core.TermProject v0)) Core.TermUnwrap v0 -> Right (forNullaryElim (Core.TermUnwrap v0))@@ -565,7 +566,7 @@ let mPrim = Lexical.lookupPrimitive graph v0 in (Optionals.cases mPrim (Right (applyToArguments original args)) (\prim -> let arity = Arity.primitiveArity prim- in (Logic.ifElse (Equality.gt arity (Lists.length args)) (Right (applyToArguments original args)) (forPrimitive prim arity args))))) (\binding -> applyIfNullary eager2 (Core.bindingTerm binding) args))+ in (Logic.ifElse (Ordering.gt arity (Lists.length args)) (Right (applyToArguments original args)) (forPrimitive prim arity args))))) (\binding -> applyIfNullary eager2 (Core.bindingTerm binding) args)) Core.TermLet v0 -> let bindings = Core.letBindings v0 body = Core.letBody v0
src/main/haskell/Hydra/Resolution.hs view
@@ -110,7 +110,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.cases (Lists.maybeHead matchingFields) noMatch (\ft -> Right (Core.fieldTypeType ft))) (Left (Errors.ErrorExtraction (Errors.ExtractionErrorMultipleFields (Errors.MultipleFieldsError {+ in (Logic.ifElse (Lists.null matchingFields) noMatch (Logic.ifElse (Equality.equal (Lists.length matchingFields) 1) (Optionals.cases (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 +121,7 @@ \depth -> \subst -> \t -> case (Strip.deannotateType t) of Core.TypeForall v0 -> let oldVar = Core.forallTypeParameter v0- newVar = Core.Name (Strings.cat2 "_" (Literals.showInt32 depth))+ newVar = Core.Name (Strings.concat2 "_" (Literals.showInt32 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 +154,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.fromOptional (Pairs.first kv) (Maps.lookup (Pairs.first kv) nameSubst), (Pairs.second kv))) (Maps.toList oldConstraints))) (Core.typeSchemeConstraints scheme)+ 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) in ( Core.TypeScheme { Core.typeSchemeVariables = newVars,@@ -189,8 +189,8 @@ Core.TypeForall v0 -> rawType (Core.forallTypeBody v0) _ -> t in (Eithers.bind (requireType cx graph name) (\t -> Optionals.cases (getter (rawType t)) (Left (Errors.ErrorResolution (Errors.ResolutionErrorUnexpectedShape (Errors.UnexpectedShapeError {- Errors.unexpectedShapeErrorExpected = (Strings.cat2 label " type"),- Errors.unexpectedShapeErrorActual = (Strings.cat2 (Core.unName name) (Strings.cat2 ": " (PrintCore.type_ t)))})))) (\x -> Right x)))+ Errors.unexpectedShapeErrorExpected = (Strings.concat2 label " type"),+ Errors.unexpectedShapeErrorActual = (Strings.concat2 (Core.unName name) (Strings.concat2 ": " (PrintCore.type_ t)))})))) (\x -> Right x))) -- | Look up a schema type and instantiate it, threading InferenceContext requireSchemaType :: Typing.InferenceContext -> M.Map Core.Name Core.TypeScheme -> Core.Name -> Either Errors.Error (Core.TypeScheme, Typing.InferenceContext)
src/main/haskell/Hydra/Scoping.hs view
@@ -68,7 +68,7 @@ g2 = extendGraphWithBindings bindings g in Graph.Graph { Graph.graphBoundTerms = (Maps.union (Maps.fromList (Lists.map (\b -> (Core.bindingName b, (Core.bindingTerm b))) bindings)) (Graph.graphBoundTerms g)),- Graph.graphBoundTypes = (Maps.union (Maps.fromList (Optionals.cat (Lists.map (\b -> Optionals.map (\ts -> (Core.bindingName b, ts)) (Core.bindingTypeScheme b)) bindings))) (Graph.graphBoundTypes g)),+ Graph.graphBoundTypes = (Maps.union (Maps.fromList (Optionals.givens (Lists.map (\b -> Optionals.map (\ts -> (Core.bindingName b, ts)) (Core.bindingTypeScheme b)) bindings))) (Graph.graphBoundTypes g)), Graph.graphClassConstraints = (Graph.graphClassConstraints g), Graph.graphLambdaVariables = (Lists.foldl (\s -> \b -> Sets.delete (Core.bindingName b) s) (Graph.graphLambdaVariables g) bindings), Graph.graphMetadata = (Graph.graphMetadata (Lists.foldl (\gAcc -> \b ->@@ -108,7 +108,7 @@ let newTerms = Maps.fromList (Lists.map (\b -> (Core.bindingName b, (Core.bindingTerm b))) bindings) newTypes =- Maps.fromList (Optionals.cat (Lists.map (\b -> Optionals.map (\ts -> (Core.bindingName b, ts)) (Core.bindingTypeScheme b)) bindings))+ Maps.fromList (Optionals.givens (Lists.map (\b -> Optionals.map (\ts -> (Core.bindingName b, ts)) (Core.bindingTypeScheme b)) bindings)) in Graph.Graph { Graph.graphBoundTerms = (Maps.union newTerms (Graph.graphBoundTerms g)), Graph.graphBoundTypes = (Maps.union newTypes (Graph.graphBoundTypes g)),@@ -176,7 +176,7 @@ let variables = Core.typeSchemeVariables ts body = Core.typeSchemeBody ts- constraintsMap = Optionals.fromOptional Maps.empty (Core.typeSchemeConstraints ts)+ constraintsMap = Optionals.withDefault Maps.empty (Core.typeSchemeConstraints ts) typeParams = Lists.map (\v -> Typing.TypeParameter { Typing.typeParameterName = v,@@ -194,7 +194,7 @@ i = Pairs.second acc in ( Lists.cons (Typing.Parameter {- Typing.parameterName = (Core.Name (Strings.cat [+ Typing.parameterName = (Core.Name (Strings.concat [ "arg", (Literals.showInt32 i)])), Typing.parameterDescription = Nothing,
src/main/haskell/Hydra/Serialization.hs view
@@ -23,6 +23,7 @@ import qualified Hydra.Overlay.Haskell.Lib.Logic as Logic import qualified Hydra.Overlay.Haskell.Lib.Math as Math 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.Strings as Strings import qualified Hydra.Packaging as Packaging@@ -79,7 +80,7 @@ -- | Pick between an inline and a multi-line layout for the same logical expression. Returns the inline form if its estimated width does not exceed the threshold, otherwise the block form. Note: the threshold is measured against the inline expression in isolation; surrounding indentation may push content beyond the threshold at print time. Callers that know they are nested can pass a smaller threshold to compensate. chooseLayout :: Int -> Ast.Expr -> Ast.Expr -> Ast.Expr chooseLayout threshold inlineExpr blockExpr =- Logic.ifElse (Equality.gt (expressionLength inlineExpr) threshold) blockExpr inlineExpr+ Logic.ifElse (Ordering.gt (expressionLength inlineExpr) threshold) blockExpr inlineExpr -- | Separate elements with a comma, using the given block style commaSep :: Ast.BlockStyle -> [Ast.Expr] -> Ast.Expr@@ -108,12 +109,12 @@ -- | 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.fromOptional "," msymb) style els))+ Logic.ifElse (Lists.null 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 customIndent idt s =- Strings.cat (Lists.intersperse "\n" (Lists.map (\line -> Logic.ifElse (Equality.equal line "") line (Strings.cat2 idt line)) (Strings.lines s)))+ Strings.concat (Lists.intersperse "\n" (Lists.map (\line -> Logic.ifElse (Equality.equal line "") line (Strings.concat2 idt line)) (Strings.lines s))) -- | Render a list of expressions as a block whose first element starts where the surrounding context placed it and subsequent elements break onto fresh lines indented by the given prefix customIndentBlock :: String -> [Ast.Expr] -> Ast.Expr@@ -127,7 +128,7 @@ Ast.paddingRight = (Ast.WsBreakAndIndent idt)}, Ast.opPrecedence = (Ast.Precedence 0), Ast.opAssociativity = Ast.AssociativityNone}- in (Optionals.cases (Lists.maybeHead els) (cst "") (\head -> Logic.ifElse (Equality.equal (Lists.length els) 1) head (ifx idtOp head (newlineSep (Lists.drop 1 els)))))+ in (Optionals.cases (Lists.head els) (cst "") (\head -> Logic.ifElse (Equality.equal (Lists.length els) 1) head (ifx idtOp head (newlineSep (Lists.drop 1 els))))) -- | Separate elements with a dot and no surrounding whitespace dotSep :: [Ast.Expr] -> Ast.Expr@@ -204,7 +205,7 @@ elementLens = Lists.map expressionLength (Ast.seqExprElements se) totalElLen = Lists.foldl Math.add 0 elementLens numSeps = Math.sub (Lists.length (Ast.seqExprElements se)) 1- in (Math.add totalElLen (Math.mul sopLen (Logic.ifElse (Equality.gt numSeps 0) numSeps 0)))+ in (Math.add totalElLen (Math.mul sopLen (Logic.ifElse (Ordering.gt numSeps 0) numSeps 0))) in case e of Ast.ExprConst v0 -> symbolLength v0 Ast.ExprIndent v0 -> indentedExpressionLength v0@@ -340,13 +341,13 @@ orSep style l = let newlines = Ast.blockStyleNewlineBeforeContent style- in (Optionals.cases (Lists.maybeHead l) (cst "") (\h -> Lists.foldl (\acc -> \el -> ifx (orOp newlines) acc el) h (Lists.drop 1 l)))+ in (Optionals.cases (Lists.head l) (cst "") (\h -> Lists.foldl (\acc -> \el -> ifx (orOp newlines) acc el) h (Lists.drop 1 l))) -- | Comma-separate the elements inside parentheses; switches to a half-block style when newlines are requested and there is more than one element. Renders as `()` when empty. parenList :: Bool -> [Ast.Expr] -> Ast.Expr parenList newlines els = - let style = Logic.ifElse (Logic.and newlines (Equality.gt (Lists.length els) 1)) halfBlockStyle inlineStyle+ 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))) -- | Produce a parenthesized list which separates elements by spaces or newlines depending on the estimated width of the expression.@@ -402,7 +403,7 @@ let lop = Ast.opExprOp v1 lprec = Ast.unPrecedence (Ast.opPrecedence lop) lassoc = Ast.opAssociativity lop- comparison = Equality.compare prec lprec+ comparison = Ordering.compare prec lprec in case comparison of Util.ComparisonLessThan -> lhs_ Util.ComparisonGreaterThan -> parens lhs_@@ -414,7 +415,7 @@ let rop = Ast.opExprOp v1 rprec = Ast.unPrecedence (Ast.opPrecedence rop) rassoc = Ast.opAssociativity rop- comparison = Equality.compare prec rprec+ comparison = Ordering.compare prec rprec in case comparison of Util.ComparisonLessThan -> rhs_ Util.ComparisonGreaterThan -> parens rhs_@@ -460,12 +461,12 @@ let style = Ast.indentedExpressionStyle v0 expr = Ast.indentedExpressionExpr v0 lns = Strings.lines (printExpr expr)- indentLine = \pre -> \line -> Logic.ifElse (Equality.equal line "") line (Strings.cat2 pre line)+ indentLine = \pre -> \line -> Logic.ifElse (Equality.equal line "") line (Strings.concat2 pre line) ilns = case style of Ast.IndentStyleAllLines v1 -> Lists.map (indentLine v1) lns- Ast.IndentStyleSubsequentLines v1 -> Logic.ifElse (Equality.equal (Lists.length lns) 1) lns (Optionals.fromOptional lns (Optionals.map (\uc -> Lists.cons (Pairs.first uc) (Lists.map (indentLine v1) (Pairs.second uc))) (Lists.uncons lns)))- in (Strings.intercalate "\n" ilns)+ Ast.IndentStyleSubsequentLines v1 -> Logic.ifElse (Equality.equal (Lists.length lns) 1) lns (Optionals.withDefault lns (Optionals.map (\uc -> Lists.cons (Pairs.first uc) (Lists.map (indentLine v1) (Pairs.second uc))) (Lists.uncons lns)))+ in (Strings.join "\n" ilns) Ast.ExprSeq v0 -> let sop = Ast.seqExprOp v0 ssym = Ast.unSymbol (Ast.opSymbol sop)@@ -484,19 +485,19 @@ spadrIsNewline = isNewlineWs spadr joinElements = \acc -> \el ->- let elStartsWithNewline = Optionals.cases (Strings.maybeCharAt 0 el) False (\c -> Equality.equal c 10)+ let elStartsWithNewline = Optionals.cases (Strings.charAt 0 el) False (\c -> Equality.equal c 10) elIsEmpty = Equality.equal el "" padlEff = Logic.ifElse (Logic.or (Logic.and elStartsWithNewline (Logic.not spadlIsNewline)) (Logic.and elIsEmpty (Equality.equal ssym ""))) "" (pad spadl) padrEff = Logic.ifElse (Logic.or (Logic.and elStartsWithNewline (Logic.not spadrIsNewline)) (Logic.and elIsEmpty (Equality.equal ssym ""))) "" (pad spadr)- in (Strings.cat [+ in (Strings.concat [ acc, padlEff, ssym, padrEff, el])- in (Optionals.cases (Lists.maybeHead printedElements) "" (\h -> Lists.foldl joinElements h (Lists.drop 1 printedElements)))+ in (Optionals.cases (Lists.head printedElements) "" (\h -> Lists.foldl joinElements h (Lists.drop 1 printedElements))) Ast.ExprOp v0 -> let op = Ast.opExprOp v0 sym = Ast.unSymbol (Ast.opSymbol op)@@ -521,9 +522,9 @@ padlEffective = Logic.ifElse (Logic.and (Logic.not padlIsNewline) (Logic.and (Equality.equal sym "") (Logic.or padrIsNewline (Equality.equal rhs "")))) "" (pad padl) padrPad = pad padr- rhsStartsWithNewline = Optionals.cases (Strings.maybeCharAt 0 rhs) False (\c -> Equality.equal c 10)+ rhsStartsWithNewline = Optionals.cases (Strings.charAt 0 rhs) False (\c -> Equality.equal c 10) padrEffective = Logic.ifElse (Logic.and rhsStartsWithNewline (Logic.not padrIsNewline)) "" padrPad- in (Strings.cat2 (Strings.cat2 (Strings.cat2 (Strings.cat2 lhs padlEffective) sym) padrEffective) rhs)+ in (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 lhs padlEffective) sym) padrEffective) rhs) Ast.ExprBrackets v0 -> let brs = Ast.bracketExprBrackets v0 l = Ast.unSymbol (Ast.bracketsOpen brs)@@ -537,7 +538,7 @@ ibody = Optionals.cases doIndent body (\pre -> customIndent pre body) pre = Logic.ifElse nlBefore "\n" "" suf = Logic.ifElse nlAfter "\n" ""- in (Strings.cat2 (Strings.cat2 (Strings.cat2 (Strings.cat2 l pre) ibody) suf) r)+ in (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 l pre) ibody) suf) r) -- | Separate elements with `;` inline semicolonSep :: [Ast.Expr] -> Ast.Expr@@ -545,8 +546,7 @@ -- | Combine a list of expressions into a single OpExpr chain using the given operator. Returns the empty constant for an empty list. sep :: Ast.Op -> [Ast.Expr] -> Ast.Expr-sep op els =- Optionals.cases (Lists.maybeHead els) (cst "") (\h -> Lists.foldl (\acc -> \el -> ifx op acc el) h (Lists.drop 1 els))+sep op els = Optionals.cases (Lists.head els) (cst "") (\h -> Lists.foldl (\acc -> \el -> ifx op acc el) h (Lists.drop 1 els)) -- | Space-separate elements (no break between them) spaceSep :: [Ast.Expr] -> Ast.Expr@@ -573,7 +573,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.fromOptional (cst "") (Lists.maybeHead els)) (Ast.ExprSeq (Ast.SeqExpr {+ Logic.ifElse (Lists.null 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}))) @@ -624,7 +624,7 @@ Ast.paddingRight = break}, Ast.opPrecedence = (Ast.Precedence 0), Ast.opAssociativity = Ast.AssociativityNone}- in (Optionals.cases (Lists.maybeHead l) (cst "") (\h -> Lists.foldl (\acc -> \el -> ifx commaOp acc el) h (Lists.drop 1 l)))+ in (Optionals.cases (Lists.head l) (cst "") (\h -> Lists.foldl (\acc -> \el -> ifx commaOp acc el) h (Lists.drop 1 l))) -- | Indent every line of an expression by four spaces tabIndent :: Ast.Expr -> Ast.Expr@@ -643,12 +643,12 @@ -- | Render a placeholder for a type the writer does not yet handle, e.g. `[bigint]` unsupportedType :: String -> Ast.Expr-unsupportedType label = cst (Strings.cat2 (Strings.cat2 "[" label) "]")+unsupportedType label = cst (Strings.concat2 (Strings.concat2 "[" label) "]") -- | Render a placeholder for an unsupported variant, including a string representation of the offending value unsupportedVariant :: String -> String -> Ast.Expr unsupportedVariant label obj =- cst (Strings.cat2 (Strings.cat2 (Strings.cat2 (Strings.cat2 "[unsupported " label) ": ") (Literals.showString obj)) "]")+ cst (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 "[unsupported " label) ": ") (Literals.printString obj)) "]") -- | Append a trailing comma to an expression withComma :: Ast.Expr -> Ast.Expr
src/main/haskell/Hydra/Sorting.hs view
@@ -19,11 +19,13 @@ 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.Functions as Functions 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.Math as Math 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.Packaging as Packaging@@ -53,14 +55,14 @@ Lists.foldl (\mp -> \p -> let k = Pairs.first p vs = Pairs.second p- existing = Optionals.cases (Maps.lookup k mp) [] Equality.identity+ existing = Optionals.cases (Maps.lookup k mp) [] Functions.identity in (Maps.insert k (Lists.concat2 existing vs) mp)) Maps.empty pairs -- | Given a list of adjacency lists represented as (key, [key]) pairs, construct a graph along with a function mapping each vertex (an Int) back to its original key (Nothing for unknown vertices). adjacencyListsToGraph :: Ord t0 => ([(t0, [t0])] -> (M.Map Int [Int], (Int -> Maybe t0))) adjacencyListsToGraph edges0 = - let sortedEdges = Lists.sortOn Pairs.first edges0+ let sortedEdges = Lists.sortBy Pairs.first edges0 indexedEdges = Lists.zip (Math.range 0 (Lists.length sortedEdges)) sortedEdges keyToVertex = Maps.fromList (Lists.map (\vkNeighbors ->@@ -90,11 +92,11 @@ let sourceToTargetMapping = \els -> let mp = Maps.fromList (Lists.zip sourceOrd els)- in (Optionals.cat (Lists.map (\n -> Maps.lookup n mp) targetOrd))+ in (Optionals.givens (Lists.map (\n -> Maps.lookup n mp) targetOrd)) targetToSourceMapping = \els -> let mp = Maps.fromList (Lists.zip targetOrd els)- in (Optionals.cat (Lists.map (\n -> Maps.lookup n mp) sourceOrd))+ in (Optionals.givens (Lists.map (\n -> Maps.lookup n mp) sourceOrd)) in Topology.OrderingIsomorphism { Topology.orderingIsomorphismEncode = sourceToTargetMapping, Topology.orderingIsomorphismDecode = targetToSourceMapping}@@ -157,8 +159,8 @@ allNodes = Sets.toList (Sets.fromList (Lists.concat2 (Lists.map Pairs.first edges) (Lists.map Pairs.first nodeTags))) getTagsForNode = \node ->- let reachable = findReachableNodes (\n -> Sets.fromList (Optionals.cases (Maps.lookup n adjMap) [] Equality.identity)) node- in (Sets.unions (Lists.map (\n -> Optionals.cases (Maps.lookup n tagMap) Sets.empty Equality.identity) (Sets.toList reachable)))+ let reachable = findReachableNodes (\n -> Sets.fromList (Optionals.cases (Maps.lookup n adjMap) [] Functions.identity)) node+ in (Sets.unions (Lists.map (\n -> Optionals.cases (Maps.lookup n tagMap) Sets.empty Functions.identity) (Sets.toList reachable))) in (Lists.map (\n -> (n, (getTagsForNode n))) allNodes) -- | Visit a vertex and recursively explore its successors@@ -184,7 +186,7 @@ in Topology.TarjanState { Topology.tarjanStateCounter = (Topology.tarjanStateCounter s), Topology.tarjanStateIndices = (Topology.tarjanStateIndices s),- Topology.tarjanStateLowLinks = (Maps.insert v (Equality.min lowV1 idx_w) (Topology.tarjanStateLowLinks s)),+ Topology.tarjanStateLowLinks = (Maps.insert v (Ordering.min lowV1 idx_w) (Topology.tarjanStateLowLinks s)), Topology.tarjanStateStack = (Topology.tarjanStateStack s), Topology.tarjanStateOnStack = (Topology.tarjanStateOnStack s), Topology.tarjanStateSccs = (Topology.tarjanStateSccs s)}@@ -195,7 +197,7 @@ in Topology.TarjanState { Topology.tarjanStateCounter = (Topology.tarjanStateCounter stAfter), Topology.tarjanStateIndices = (Topology.tarjanStateIndices stAfter),- Topology.tarjanStateLowLinks = (Maps.insert v (Equality.min lowV2 low_w) (Topology.tarjanStateLowLinks stAfter)),+ Topology.tarjanStateLowLinks = (Maps.insert v (Ordering.min lowV2 low_w) (Topology.tarjanStateLowLinks stAfter)), Topology.tarjanStateStack = (Topology.tarjanStateStack stAfter), Topology.tarjanStateOnStack = (Topology.tarjanStateOnStack stAfter), Topology.tarjanStateSccs = (Topology.tarjanStateSccs stAfter)}) (Logic.ifElse (Sets.member w (Topology.tarjanStateOnStack st_)) (lowLink st_) st_))@@ -228,7 +230,7 @@ topologicalSort pairs = let sccs = topologicalSortComponents pairs- isCycle = \scc -> Equality.gt (Lists.length scc) 1+ 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)) @@ -247,4 +249,4 @@ let nodesByKey = Maps.fromList (Lists.map (\n -> (getKey n, n)) nodes) pairs = Lists.map (\n -> (getKey n, (getAdj n))) nodes comps = topologicalSortComponents pairs- in (Lists.map (\c -> Optionals.cat (Lists.map (\k -> Maps.lookup k nodesByKey) c)) comps)+ in (Lists.map (\c -> Optionals.givens (Lists.map (\k -> Maps.lookup k nodesByKey) c)) comps)
src/main/haskell/Hydra/Substitution.hs view
@@ -79,7 +79,7 @@ \varName -> \metadata -> \acc -> Optionals.cases (Maps.lookup varName acc) (Maps.insert varName metadata acc) (\existing -> let merged = Core.TypeVariableConstraints {- Core.typeVariableConstraintsClasses = (Lists.nub (Lists.concat2 (Core.typeVariableConstraintsClasses existing) (Core.typeVariableConstraintsClasses metadata)))}+ 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
src/main/haskell/Hydra/Templates.hs view
@@ -114,7 +114,7 @@ e])))) Core.TypeVariable v0 -> Optionals.cases (Maps.lookup v0 schema) (Left (Errors.ErrorResolution (Errors.ResolutionErrorUnexpectedShape (Errors.UnexpectedShapeError { Errors.unexpectedShapeErrorExpected = "bound type variable",- Errors.unexpectedShapeErrorActual = (Strings.cat2 "unbound variable " (Core.unName v0))})))) (inst v0)+ Errors.unexpectedShapeErrorActual = (Strings.concat2 "unbound variable " (Core.unName v0))})))) (inst v0) Core.TypeWrap v0 -> Eithers.bind (inst tname v0) (\e -> Right (Core.TermWrap (Core.WrappedTerm { Core.wrappedTermTypeName = tname, Core.wrappedTermBody = e})))
src/main/haskell/Hydra/Test/Transform.hs view
@@ -46,7 +46,7 @@ -- | Add generation namespace prefix addGenerationPrefix :: Packaging.ModuleName -> Packaging.ModuleName-addGenerationPrefix ns_ = Packaging.ModuleName (Strings.cat2 "generation." (Packaging.unModuleName ns_))+addGenerationPrefix ns_ = Packaging.ModuleName (Strings.concat2 "generation." (Packaging.unModuleName ns_)) -- | Build a Term representing a convertCase function call buildConvertCaseCall :: Util.CaseConvention -> Util.CaseConvention -> String -> Core.Term@@ -134,8 +134,8 @@ desc = Testing.testGroupDescription tg subgroups = Testing.testGroupSubgroups tg cases_ = Testing.testGroupCases tg- transformedCases = Optionals.cat (Lists.map (\tc -> transformTestCase tc) cases_)- transformedSubgroups = Optionals.cat (Lists.map (\sg -> transformToCompiledTests sg) subgroups)+ 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 { Testing.testGroupName = name_, Testing.testGroupDescription = desc,
src/main/haskell/Hydra/Unification.hs view
@@ -59,12 +59,12 @@ \l -> \r -> Typing.TypeConstraint { Typing.typeConstraintLeft = l, Typing.typeConstraintRight = r,- Typing.typeConstraintComment = (Strings.cat2 "join types; " comment)}+ Typing.typeConstraintComment = (Strings.concat2 "join types; " comment)} cannotUnify = Left (Errors.UnificationError { Errors.unificationErrorLeftType = sleft, Errors.unificationErrorRightType = sright,- Errors.unificationErrorMessage = (Strings.cat2 (Strings.cat2 (Strings.cat2 "cannot unify " (PrintCore.type_ sleft)) " with ") (PrintCore.type_ sright))})+ Errors.unificationErrorMessage = (Strings.concat2 (Strings.concat2 (Strings.concat2 "cannot unify " (PrintCore.type_ sleft)) " with ") (PrintCore.type_ sright))}) assertEqual = Logic.ifElse (Equality.equal sleft sright) (Right []) cannotUnify joinList = \lefts -> \rights -> Logic.ifElse (Equality.equal (Lists.length lefts) (Lists.length rights)) (Right (Lists.zipWith joinOne lefts rights)) cannotUnify@@ -154,7 +154,7 @@ \v -> \t -> Logic.ifElse (variableOccursInType v t) (Left (Errors.UnificationError { Errors.unificationErrorLeftType = sleft, Errors.unificationErrorRightType = sright,- Errors.unificationErrorMessage = (Strings.cat2 (Strings.cat2 (Strings.cat2 (Strings.cat2 (Strings.cat2 (Strings.cat2 "Variable " (Core.unName v)) " appears free in type ") (PrintCore.type_ t)) " (") comment) ")")})) (bind v t)+ Errors.unificationErrorMessage = (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 "Variable " (Core.unName v)) " appears free in type ") (PrintCore.type_ t)) " (") comment) ")")})) (bind v t) noVars = let withConstraints = \constraints2 -> unifyTypeConstraints cx schemaTypes (Lists.concat2 constraints2 rest)@@ -168,7 +168,7 @@ Core.TypeVariable v1 -> Logic.ifElse (Equality.equal (Core.unName v0) (Core.unName v1)) (unifyTypeConstraints cx schemaTypes rest) (Logic.ifElse (Optionals.isGiven (Maps.lookup v0 schemaTypes)) (Logic.ifElse (Optionals.isGiven (Maps.lookup v1 schemaTypes)) (Left (Errors.UnificationError { Errors.unificationErrorLeftType = sleft, Errors.unificationErrorRightType = sright,- Errors.unificationErrorMessage = (Strings.cat2 (Strings.cat2 (Strings.cat2 (Strings.cat2 (Strings.cat2 (Strings.cat2 "Attempted to unify schema names " (Core.unName v0)) " and ") (Core.unName v1)) " (") comment) ")")})) (bind v1 sleft)) (bind v0 sright))+ Errors.unificationErrorMessage = (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 (Strings.concat2 "Attempted to unify schema names " (Core.unName v0)) " and ") (Core.unName v1)) " (") comment) ")")})) (bind v1 sleft)) (bind v0 sright)) _ -> tryBinding v0 sright _ -> dflt in (Optionals.cases (Lists.uncons constraints) (Right Substitution.idTypeSubst) (\uc -> withConstraint (Pairs.first uc) (Pairs.second uc)))
src/main/haskell/Hydra/Validate/Core.hs view
@@ -23,6 +23,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.Ordering as Ordering import qualified Hydra.Overlay.Haskell.Lib.Pairs as Pairs import qualified Hydra.Overlay.Haskell.Lib.Sets as Sets import qualified Hydra.Packaging as Packaging@@ -58,9 +59,9 @@ payload = Pairs.second rp errs = Validation.validationResultErrors acc wrns = Validation.validationResultWarnings acc- in (Logic.ifElse (Sets.member ruleName (Validation.validationProfileErrorRules p)) (Logic.ifElse (Equality.lt (Lists.length errs) (Validation.validationProfileMaxErrors p)) (Validation.ValidationResult {+ in (Logic.ifElse (Sets.member ruleName (Validation.validationProfileErrorRules p)) (Logic.ifElse (Ordering.lt (Lists.length errs) (Validation.validationProfileMaxErrors p)) (Validation.ValidationResult { Validation.validationResultErrors = (Lists.concat2 errs (Lists.singleton payload)),- Validation.validationResultWarnings = wrns}) acc) (Logic.ifElse (Sets.member ruleName (Validation.validationProfileWarningRules p)) (Logic.ifElse (Equality.lt (Lists.length wrns) (Validation.validationProfileMaxWarnings p)) (Validation.ValidationResult {+ Validation.validationResultWarnings = wrns}) acc) (Logic.ifElse (Sets.member ruleName (Validation.validationProfileWarningRules p)) (Logic.ifElse (Ordering.lt (Lists.length wrns) (Validation.validationProfileMaxWarnings p)) (Validation.ValidationResult { Validation.validationResultErrors = errs, Validation.validationResultWarnings = (Lists.concat2 wrns (Lists.singleton payload))}) acc) acc))) @@ -72,9 +73,9 @@ payload = Pairs.second rp errs = Validation.validationResultErrors acc wrns = Validation.validationResultWarnings acc- in (Logic.ifElse (Sets.member ruleName (Validation.validationProfileErrorRules p)) (Logic.ifElse (Equality.lt (Lists.length errs) (Validation.validationProfileMaxErrors p)) (Validation.ValidationResult {+ in (Logic.ifElse (Sets.member ruleName (Validation.validationProfileErrorRules p)) (Logic.ifElse (Ordering.lt (Lists.length errs) (Validation.validationProfileMaxErrors p)) (Validation.ValidationResult { Validation.validationResultErrors = (Lists.concat2 errs (Lists.singleton payload)),- Validation.validationResultWarnings = wrns}) acc) (Logic.ifElse (Sets.member ruleName (Validation.validationProfileWarningRules p)) (Logic.ifElse (Equality.lt (Lists.length wrns) (Validation.validationProfileMaxWarnings p)) (Validation.ValidationResult {+ Validation.validationResultWarnings = wrns}) acc) (Logic.ifElse (Sets.member ruleName (Validation.validationProfileWarningRules p)) (Logic.ifElse (Ordering.lt (Lists.length wrns) (Validation.validationProfileMaxWarnings p)) (Validation.ValidationResult { Validation.validationResultErrors = errs, Validation.validationResultWarnings = (Lists.concat2 wrns (Lists.singleton payload))}) acc) acc))) @@ -240,7 +241,7 @@ (Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTermError.unknownCaseAlternative")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTermError.unknownCaseAlternative", f)) (Optionals.cases unionFields Nothing (\fields -> let variantNames = Sets.fromList (Lists.map Core.fieldTypeName fields) unknown = Sets.difference altNames variantNames- in (Optionals.cases (Lists.maybeHead (Sets.toList unknown)) Nothing (\firstUnknown -> Just (ErrorCore.InvalidTermErrorUnknownCaseAlternative (ErrorCore.UnknownCaseAlternativeError {+ in (Optionals.cases (Lists.head (Sets.toList unknown)) Nothing (\firstUnknown -> Just (ErrorCore.InvalidTermErrorUnknownCaseAlternative (ErrorCore.UnknownCaseAlternativeError { ErrorCore.unknownCaseAlternativeErrorLocation = path, ErrorCore.unknownCaseAlternativeErrorTypeName = tname, ErrorCore.unknownCaseAlternativeErrorName = firstUnknown}))))))) Nothing)])@@ -272,7 +273,7 @@ let freeVars = Variables.freeVariablesInType typ resolvedNames = Sets.union (Graph.graphTypeVariables cx) (Sets.fromList (Maps.keys (Graph.graphSchemaTypes cx))) undefined = Sets.difference freeVars resolvedNames- in (Optionals.cases (Lists.maybeHead (Sets.toList undefined)) Nothing (\firstUndefined -> mkError firstUndefined))+ in (Optionals.cases (Lists.head (Sets.toList undefined)) Nothing (\firstUndefined -> mkError firstUndefined)) -- | Check a type scheme for type variables not bound by the scheme or the current scope checkUndefinedTypeVariablesInTypeScheme :: t0 -> Graph.Graph -> Core.TypeScheme -> (Core.Name -> Maybe t1) -> Maybe t1@@ -281,7 +282,7 @@ let freeVars = Variables.freeVariablesInTypeScheme ts resolvedNames = Sets.union (Graph.graphTypeVariables cx) (Sets.fromList (Maps.keys (Graph.graphSchemaTypes cx))) undefined = Sets.difference freeVars resolvedNames- in (Optionals.cases (Lists.maybeHead (Sets.toList undefined)) Nothing (\firstUndefined -> mkError firstUndefined))+ in (Optionals.cases (Lists.head (Sets.toList undefined)) Nothing (\firstUndefined -> mkError firstUndefined)) -- | Return an error if the given type is TypeVoid checkVoid :: Core.Type -> Maybe ErrorCore.InvalidTypeError@@ -400,18 +401,18 @@ -- | Validate a term against the given ValidationProfile, returning a ValidationResult. Errors hard-stop traversal once maxErrors is reached; warnings are bounded by maxWarnings without causing termination. term :: Validation.ValidationProfile -> Bool -> Graph.Graph -> Core.Term -> Validation.ValidationResult ErrorCore.InvalidTermError term p typed g t =- Rewriting.foldTermWithGraphAndPath (\recurse -> \path -> \cx -> \acc -> \trm -> Logic.ifElse (Equality.gte (Lists.length (Validation.validationResultErrors acc)) (Validation.validationProfileMaxErrors p)) acc (+ Rewriting.foldTermWithGraphAndPath (\recurse -> \path -> \cx -> \acc -> \trm -> Logic.ifElse (Ordering.gte (Lists.length (Validation.validationResultErrors acc)) (Validation.validationProfileMaxErrors p)) acc ( let acc1 = appendFinding p acc (checkTerm p typed (Paths.SubtermPath path) cx trm)- in (Logic.ifElse (Equality.gte (Lists.length (Validation.validationResultErrors acc1)) (Validation.validationProfileMaxErrors p)) acc1 (recurse acc1 trm)))) g (Validation.ValidationResult {+ in (Logic.ifElse (Ordering.gte (Lists.length (Validation.validationResultErrors acc1)) (Validation.validationProfileMaxErrors p)) acc1 (recurse acc1 trm)))) g (Validation.ValidationResult { Validation.validationResultErrors = [], Validation.validationResultWarnings = []}) t -- | Validate a type against the given ValidationProfile, threading a ValidationResult accumulator through subtypes. Errors hard-stop traversal once maxErrors is reached. type_ :: Validation.ValidationProfile -> Validation.ValidationResult ErrorCore.InvalidTypeError -> S.Set Core.Name -> Core.Type -> Validation.ValidationResult ErrorCore.InvalidTypeError type_ p acc boundVars typ =- Logic.ifElse (Equality.gte (Lists.length (Validation.validationResultErrors acc)) (Validation.validationProfileMaxErrors p)) acc (+ Logic.ifElse (Ordering.gte (Lists.length (Validation.validationResultErrors acc)) (Validation.validationProfileMaxErrors p)) acc ( let acc1 = appendFindingType p acc (validateTypeNode p boundVars typ)- in (Logic.ifElse (Equality.gte (Lists.length (Validation.validationResultErrors acc1)) (Validation.validationProfileMaxErrors p)) acc1 (case typ of+ in (Logic.ifElse (Ordering.gte (Lists.length (Validation.validationResultErrors acc1)) (Validation.validationProfileMaxErrors p)) acc1 (case typ of Core.TypeForall v0 -> let newBound = Sets.insert (Core.forallTypeParameter v0) boundVars in (type_ p acc1 newBound (Core.forallTypeBody v0))@@ -499,7 +500,7 @@ 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 { 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.cases (Lists.maybeHead v0) Nothing (\singleField -> Just (ErrorCore.InvalidTypeErrorSingleVariantUnion (ErrorCore.SingleVariantUnionError {+ (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.cases (Lists.head v0) Nothing (\singleField -> Just (ErrorCore.InvalidTypeErrorSingleVariantUnion (ErrorCore.SingleVariantUnionError { ErrorCore.singleVariantUnionErrorLocation = (Paths.SubtermPath []), ErrorCore.singleVariantUnionErrorFieldName = (Core.fieldTypeName singleField)})))) Nothing)) Nothing), (Logic.ifElse (enabled p (Core.Name "hydra.error.core.InvalidTypeError.duplicateUnionTypeFieldNames")) (Optionals.map (\f -> (Core.Name "hydra.error.core.InvalidTypeError.duplicateUnionTypeFieldNames", f)) (checkDuplicateFieldTypes v0 (\dupName -> Just (ErrorCore.InvalidTypeErrorDuplicateUnionTypeFieldNames (ErrorCore.DuplicateUnionTypeFieldNamesError {
src/main/haskell/Hydra/Validate/Packaging.hs view
@@ -26,6 +26,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.Ordering as Ordering import qualified Hydra.Overlay.Haskell.Lib.Pairs as Pairs import qualified Hydra.Overlay.Haskell.Lib.Regex as LibRegex import qualified Hydra.Overlay.Haskell.Lib.Sets as Sets@@ -61,9 +62,9 @@ payload = Pairs.second rp errs = Validation.validationResultErrors acc wrns = Validation.validationResultWarnings acc- in (Logic.ifElse (Sets.member ruleName (Validation.validationProfileErrorRules p)) (Logic.ifElse (Equality.lt (Lists.length errs) (Validation.validationProfileMaxErrors p)) (Validation.ValidationResult {+ in (Logic.ifElse (Sets.member ruleName (Validation.validationProfileErrorRules p)) (Logic.ifElse (Ordering.lt (Lists.length errs) (Validation.validationProfileMaxErrors p)) (Validation.ValidationResult { Validation.validationResultErrors = (Lists.concat2 errs (Lists.singleton payload)),- Validation.validationResultWarnings = wrns}) acc) (Logic.ifElse (Sets.member ruleName (Validation.validationProfileWarningRules p)) (Logic.ifElse (Equality.lt (Lists.length wrns) (Validation.validationProfileMaxWarnings p)) (Validation.ValidationResult {+ Validation.validationResultWarnings = wrns}) acc) (Logic.ifElse (Sets.member ruleName (Validation.validationProfileWarningRules p)) (Logic.ifElse (Ordering.lt (Lists.length wrns) (Validation.validationProfileMaxWarnings p)) (Validation.ValidationResult { Validation.validationResultErrors = errs, Validation.validationResultWarnings = (Lists.concat2 wrns (Lists.singleton payload))}) acc) acc))) @@ -75,9 +76,9 @@ payload = Pairs.second rp errs = Validation.validationResultErrors acc wrns = Validation.validationResultWarnings acc- in (Logic.ifElse (Sets.member ruleName (Validation.validationProfileErrorRules p)) (Logic.ifElse (Equality.lt (Lists.length errs) (Validation.validationProfileMaxErrors p)) (Validation.ValidationResult {+ in (Logic.ifElse (Sets.member ruleName (Validation.validationProfileErrorRules p)) (Logic.ifElse (Ordering.lt (Lists.length errs) (Validation.validationProfileMaxErrors p)) (Validation.ValidationResult { Validation.validationResultErrors = (Lists.concat2 errs (Lists.singleton payload)),- Validation.validationResultWarnings = wrns}) acc) (Logic.ifElse (Sets.member ruleName (Validation.validationProfileWarningRules p)) (Logic.ifElse (Equality.lt (Lists.length wrns) (Validation.validationProfileMaxWarnings p)) (Validation.ValidationResult {+ Validation.validationResultWarnings = wrns}) acc) (Logic.ifElse (Sets.member ruleName (Validation.validationProfileWarningRules p)) (Logic.ifElse (Ordering.lt (Lists.length wrns) (Validation.validationProfileMaxWarnings p)) (Validation.ValidationResult { Validation.validationResultErrors = errs, Validation.validationResultWarnings = (Lists.concat2 wrns (Lists.singleton payload))}) acc) acc))) @@ -116,7 +117,7 @@ Core.TypeUnion v1 -> Lists.foldl (\innerAcc -> \field -> Optionals.cases innerAcc ( let fieldName = Core.fieldTypeName field localFieldName = Names.localNameOf fieldName- constructorName = Strings.cat2 (Formatting.capitalize localTypeName) (Formatting.capitalize localFieldName)+ constructorName = Strings.concat2 (Formatting.capitalize localTypeName) (Formatting.capitalize localFieldName) in (Logic.ifElse (Sets.member constructorName defNames) (Just (ErrorPackaging.InvalidModuleErrorConflictingVariantName (ErrorPackaging.ConflictingVariantNameError { ErrorPackaging.conflictingVariantNameErrorModuleName = ns, ErrorPackaging.conflictingVariantNameErrorTypeName = typeName,@@ -144,7 +145,7 @@ in case typ of Core.TypeAnnotated v1 -> Annotations.hasDescription (Annotations.getAnnotationMap (Core.annotatedTypeAnnotation v1)) _ -> False- Packaging.DefinitionPrimitive v0 -> Optionals.cases (Packaging.primitiveDefinitionMetadata v0) False (\em -> Logic.not (Equality.equal (Optionals.fromOptional "" (Packaging.entityMetadataDescription em)) ""))+ Packaging.DefinitionPrimitive v0 -> Optionals.cases (Packaging.primitiveDefinitionMetadata v0) False (\em -> Logic.not (Equality.equal (Optionals.withDefault "" (Packaging.entityMetadataDescription em)) "")) _ -> False in (Logic.ifElse documented Nothing (Just (ErrorPackaging.InvalidModuleErrorMissingDocumentation (ErrorPackaging.MissingDocumentationError { ErrorPackaging.missingDocumentationErrorModuleName = ns,@@ -155,7 +156,7 @@ checkDefinitionModuleNames mod = let ns = Packaging.moduleName mod- prefix = Strings.cat2 (Packaging.unModuleName ns) "."+ prefix = Strings.concat2 (Packaging.unModuleName ns) "." prefixLen = Strings.length prefix in (Lists.foldl (\acc -> \def -> Optionals.cases acc ( let name = definitionName def@@ -204,7 +205,7 @@ currLocal = Names.localNameOf currName in (Optionals.cases prev (Just currName, Nothing) (\prevName -> let prevLocal = Names.localNameOf prevName- in (Logic.ifElse (Equality.lt prevLocal currLocal) (Just currName, Nothing) (+ in (Logic.ifElse (Ordering.lt prevLocal currLocal) (Just currName, Nothing) ( Just currName, (Just (ErrorPackaging.InvalidModuleErrorDefinitionsOutOfOrder (ErrorPackaging.DefinitionsOutOfOrderError { ErrorPackaging.definitionsOutOfOrderErrorModuleName = ns,@@ -317,14 +318,14 @@ -- | Validate a kernel module against all kernel-default packaging rules; returns the first error found or nothing if valid. Convenience wrapper around 'module'' with 'kernelDefaultPackagingProfile'. kernelModule :: Packaging.Module -> Maybe ErrorPackaging.InvalidModuleError kernelModule mod =- Lists.maybeHead (Validation.validationResultErrors (module_ kernelDefaultPackagingProfile (Validation.ValidationResult {+ Lists.head (Validation.validationResultErrors (module_ kernelDefaultPackagingProfile (Validation.ValidationResult { Validation.validationResultErrors = [], Validation.validationResultWarnings = []}) mod)) -- | Validate a kernel package against all kernel-default packaging rules; returns the first error found or nothing if valid. Convenience wrapper around 'package' with 'kernelDefaultPackagingProfile'. kernelPackage :: Packaging.Package -> Maybe ErrorPackaging.InvalidPackageError kernelPackage pkg =- Lists.maybeHead (Validation.validationResultErrors (package kernelDefaultPackagingProfile (Validation.ValidationResult {+ Lists.head (Validation.validationResultErrors (package kernelDefaultPackagingProfile (Validation.ValidationResult { Validation.validationResultErrors = [], Validation.validationResultWarnings = []}) pkg)) @@ -357,7 +358,7 @@ -- | Validate a module against the given ValidationProfile, accumulating findings into a ValidationResult. Errors hard-stop the rule sequence once maxErrors is reached. module_ :: Validation.ValidationProfile -> Validation.ValidationResult ErrorPackaging.InvalidModuleError -> Packaging.Module -> Validation.ValidationResult ErrorPackaging.InvalidModuleError module_ p acc0 mod =- Lists.foldl (\acc -> \guarded -> Logic.ifElse (Equality.gte (Lists.length (Validation.validationResultErrors acc)) (Validation.validationProfileMaxErrors p)) acc (appendFindingModule p acc guarded)) acc0 [+ Lists.foldl (\acc -> \guarded -> Logic.ifElse (Ordering.gte (Lists.length (Validation.validationResultErrors acc)) (Validation.validationProfileMaxErrors p)) acc (appendFindingModule p acc guarded)) acc0 [ Logic.ifElse (enabledPackaging p (Core.Name "hydra.error.packaging.InvalidModuleError.conflictingVariantName")) (Optionals.map (\f -> (Core.Name "hydra.error.packaging.InvalidModuleError.conflictingVariantName", f)) (checkConflictingVariantNames mod)) Nothing, (Logic.ifElse (enabledPackaging p (Core.Name "hydra.error.packaging.InvalidModuleError.missingDocumentation")) (Optionals.map (\f -> (Core.Name "hydra.error.packaging.InvalidModuleError.missingDocumentation", f)) (checkDefinitionDocumentation mod)) Nothing), (Logic.ifElse (enabledPackaging p (Core.Name "hydra.error.packaging.InvalidModuleError.invalidDefinitionName")) (Optionals.map (\f -> (Core.Name "hydra.error.packaging.InvalidModuleError.invalidDefinitionName", f)) (checkDefinitionNameConvention mod)) Nothing),@@ -371,11 +372,11 @@ package p acc0 pkg = let accPkg =- Lists.foldl (\acc -> \guarded -> Logic.ifElse (Equality.gte (Lists.length (Validation.validationResultErrors acc)) (Validation.validationProfileMaxErrors p)) acc (appendFindingPackage p acc guarded)) acc0 [+ Lists.foldl (\acc -> \guarded -> Logic.ifElse (Ordering.gte (Lists.length (Validation.validationResultErrors acc)) (Validation.validationProfileMaxErrors p)) acc (appendFindingPackage p acc guarded)) acc0 [ Logic.ifElse (enabledPackaging p (Core.Name "hydra.error.packaging.InvalidPackageError.conflictingModuleName")) (Optionals.map (\f -> (Core.Name "hydra.error.packaging.InvalidPackageError.conflictingModuleName", f)) (checkConflictingModuleNames pkg)) Nothing, (Logic.ifElse (enabledPackaging p (Core.Name "hydra.error.packaging.InvalidPackageError.duplicateModuleName")) (Optionals.map (\f -> (Core.Name "hydra.error.packaging.InvalidPackageError.duplicateModuleName", f)) (checkDuplicateModuleNames pkg)) Nothing), (Logic.ifElse (enabledPackaging p (Core.Name "hydra.error.packaging.InvalidPackageError.invalidPackageName")) (Optionals.map (\f -> (Core.Name "hydra.error.packaging.InvalidPackageError.invalidPackageName", f)) (checkPackageNameConvention pkg)) Nothing)]- in (Lists.foldl (\acc -> \mod -> Logic.ifElse (Equality.gte (Lists.length (Validation.validationResultErrors acc)) (Validation.validationProfileMaxErrors p)) acc (+ in (Lists.foldl (\acc -> \mod -> Logic.ifElse (Ordering.gte (Lists.length (Validation.validationResultErrors acc)) (Validation.validationProfileMaxErrors p)) acc ( let mr = module_ p (Validation.ValidationResult { Validation.validationResultErrors = [],
src/main/haskell/Hydra/Variables.hs view
@@ -107,7 +107,7 @@ v0] Core.TypeForall v0 -> collectVars (Sets.insert (Core.forallTypeParameter v0) boundVars) (Core.forallTypeBody v0) _ -> Lists.concat (Lists.map (collectVars boundVars) (Rewriting.subtypes t))- in (Lists.nub (collectVars Sets.empty typ))+ in (Lists.distinct (collectVars Sets.empty typ)) -- | Find free variables in a type scheme freeVariablesInTypeScheme :: Core.TypeScheme -> S.Set Core.Name@@ -143,7 +143,7 @@ normalizeTypeVariablesInTerm :: Core.Term -> Core.Term normalizeTypeVariablesInTerm term = - let replaceName = \subst -> \v -> Optionals.fromOptional v (Maps.lookup v subst)+ let replaceName = \subst -> \v -> Optionals.withDefault v (Maps.lookup v subst) substType = \subst -> \typ -> let rewrite =@@ -188,7 +188,7 @@ k = Lists.length vars gen = \i -> \rem -> \acc2 ->- let ti = Core.Name (Strings.cat2 "t" (Literals.showInt32 (Math.add next i)))+ let ti = Core.Name (Strings.concat2 "t" (Literals.showInt32 (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@@ -198,7 +198,7 @@ \constraintMap -> Maps.fromList (Lists.map (\p -> let oldName = Pairs.first p meta = Pairs.second p- newName = Optionals.fromOptional oldName (Maps.lookup oldName newSubst)+ newName = Optionals.withDefault oldName (Maps.lookup oldName newSubst) in (newName, meta)) (Maps.toList constraintMap)) oldConstraints = Core.typeSchemeConstraints ts newConstraints = Optionals.map renameConstraintKeys oldConstraints@@ -258,7 +258,7 @@ let replace = \recurse -> \typ2 -> case typ2 of- Core.TypeVariable v0 -> Core.TypeVariable (Optionals.fromOptional v0 (Maps.lookup v0 subst))+ Core.TypeVariable v0 -> Core.TypeVariable (Optionals.withDefault v0 (Maps.lookup v0 subst)) _ -> recurse typ2 in (Rewriting.rewriteType replace typ) @@ -279,7 +279,7 @@ let replace = \recurse -> \term2 -> case term2 of- Core.TermVariable v0 -> Core.TermVariable (Optionals.fromOptional v0 (Maps.lookup v0 subst))+ Core.TermVariable v0 -> Core.TermVariable (Optionals.withDefault v0 (Maps.lookup v0 subst)) Core.TermLambda v0 -> Optionals.cases (Maps.lookup (Core.lambdaParameter v0) subst) (recurse term2) (\_ -> term2) _ -> recurse term2 in (Rewriting.rewriteTerm replace term)@@ -290,7 +290,7 @@ let freshName = \base -> \i -> \m ->- let candidate = Core.Name (Strings.cat2 (Core.unName base) (Literals.showInt32 i))+ let candidate = Core.Name (Strings.concat2 (Core.unName base) (Literals.showInt32 i)) in (Logic.ifElse (Maps.member candidate m) (freshName base (Math.add i 1) m) candidate) f = \recurse -> \m -> \term -> case term of