split package:ghc

The expression (split k map) is a pair (map1,map2) where all keys in map1 are lower than k and all keys in map2 larger than k. Any key equal to k is found in neither map1 nor map2.
split 2 (fromList [(5,"a"), (3,"b")]) == (empty, fromList [(3,"b"), (5,"a")])
split 3 (fromList [(5,"a"), (3,"b")]) == (empty, singleton 5 "a")
split 4 (fromList [(5,"a"), (3,"b")]) == (singleton 3 "b", singleton 5 "a")
split 5 (fromList [(5,"a"), (3,"b")]) == (singleton 3 "b", empty)
split 6 (fromList [(5,"a"), (3,"b")]) == (fromList [(3,"b"), (5,"a")], empty)
The expression (split x set) is a pair (set1,set2) where set1 comprises the elements of set less than x and set2 comprises the elements of set greater than x.
split 3 (fromList [1..5]) == (fromList [1,2], fromList [4,5])
Take a ForAllTy apart, returning the list of tycovars and the result type. This always succeeds, even if it returns only an empty list. Note that the result type returned may have free variables that were bound by a forall.
Attempt to take a coercion application apart.
Like splitForAllCo_maybe, but only returns Just for covar binder
Like splitForAllCo_maybe, but only returns Just for tyvar binder
Extract the type constructor, type argument, data constructor and it's representation argument types from a type if it is a product type. Precisely, we return Just for any data type that is all of:
  • Concrete (i.e. constructors visible)
  • Single-constructor
  • ... which has no existentials
Whether the type is a data type or a newtype.
Attempts to take a type application apart, as in splitAppTy_maybe, and panics if this is not possible
Does the AppTy split as in splitAppTy_maybe, but assumes that any coreView stuff is already done
Attempt to take a type application apart, whether it is a function, type constructor, or plain type application. Note that type family applications are NEVER unsaturated by this!
Recursively splits a type as far as is possible, leaving a residual type being applied to and the type arguments applied to it. Never fails, even if that means returning an empty list of type applications.
Like splitAppTys, but doesn't look through type synonyms
Like splitForAllTyCoVar_maybe, but only returns Just if it is a covar binder.
Attempts to take a ForAllTy apart, returning the full ForAllTyBinder
Take a ForAllTy apart, returning the binders and result type
Like splitForAllTyCoVars, but only splits ForAllTys with Invisible type variable binders. Furthermore, each returned tyvar is annotated with its Specificity.
Like splitForAllTyCoVars, but only splits ForAllTys with Required type variable binders. Furthermore, each returned tyvar is annotated with ().
Take a forall type apart, or panics if that is not possible.
Attempts to take a ForAllTy apart, returning the Var