This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE RequiredTypeArguments #-} | |
| module AnnotatedArrows ( | |
| (<--<), (>--), | |
| (--<), (>-->), | |
| ) where | |
| infixr 9 <--<, >-- | |
| (<--<) :: (b -> c) -> (a -> b) -> a -> c |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# | |
| LANGUAGE | |
| RankNTypes, DataKinds, | |
| RoleAnnotations, StandaloneKindSignatures, | |
| DerivingVia, BlockArguments | |
| #-} | |
| module Control.Monad.Trans.Masked ( | |
| Masked, | |
| Interruptibility(..), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# OPTIONS_GHC -Wno-unused-foralls #-} | |
| {-# | |
| LANGUAGE | |
| UnliftedNewtypes, UnboxedTuples, DataKinds, LinearTypes, TypeFamilies, | |
| RoleAnnotations, RequiredTypeArguments, LiberalTypeSynonyms | |
| #-} | |
| module Fresh ( | |
| Source, create, destroy, | |
| type ( # ), fresh, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE GADTs, PatternSynonyms, LambdaCase, BlockArguments #-} | |
| module Traced ( | |
| Traced(..), | |
| catchTraced, | |
| trace, | |
| ) where | |
| -- base | |
| import Type.Reflection (typeOf, pattern App) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# | |
| LANGUAGE | |
| GHC2021, GADTs, DataKinds, ExplicitNamespaces, BlockArguments, LambdaCase | |
| #-} | |
| module Apart (apart, equal, boolean) where | |
| import Data.Void (Void) | |
| import Data.Type.Equality ((:~:)(..), type (==)) | |
| import Data.Bifunctor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# | |
| LANGUAGE | |
| GHC2021, BlockArguments, DataKinds, TypeFamilies, RequiredTypeArguments | |
| #-} | |
| module Stack ( | |
| Stack, run, | |
| push, dup, rot, | |
| apply, plus, minus, times, | |
| ) where |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# | |
| LANGUAGE | |
| GHC2021, PatternSynonyms, ViewPatterns, ExplicitNamespaces, GADTs | |
| #-} | |
| module Is (pattern Is) where | |
| -- base | |
| import Type.Reflection | |
| import Data.Type.Equality (type (~~)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# LANGUAGE GHC2021, BlockArguments, ExplicitNamespaces, DerivingVia #-} | |
| module Memo ( | |
| -- * Memoisation Functions | |
| memo, memoFix, | |
| -- * Memoised Function Type | |
| type (-->), | |
| toMemo, ($$), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| bindIntegralS :: (Selective f, Integral a) => f a -> (a -> f b) -> f b | |
| bindIntegralS fn k = pivot 0 (findLB (-1) 0) (findUB 0 1) | |
| where | |
| pivot !m = ifS $ fn <&> (< m) | |
| findLB m ub = pivot m (findLB (m * 2) m) (bs m ub) | |
| findUB lb m = pivot m (bs lb m) (findUB m (m * 2)) | |
| bs lb ub | |
| | ub - lb <= 1 = k lb | |
| | otherwise = pivot mid (bs lb mid) (bs mid ub) | |
| where mid = (lb + ub) `div` 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {-# OPTIONS_GHC -Wno-inaccessible-code -Wno-overlapping-patterns #-} | |
| {-# LANGUAGE GHC2021, GADTs #-} | |
| module ArchWS (ArchWS(..), archWS) where | |
| -- base | |
| import Data.Coerce (Coercible, coerce) | |
| import Data.Type.Coercion (Coercion(..)) | |
| import Data.Word (Word32, Word64) | |
| import Data.Int (Int32, Int64) |
NewerOlder