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
| -- Using https://hackage.haskell.org/package/squares | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE TypeFamilies #-} | |
| {-# LANGUAGE DeriveFunctor #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE PolyKinds #-} | |
| {-# LANGUAGE MultiParamTypeClasses #-} | |
| {-# LANGUAGE FlexibleInstances #-} | |
| {-# LANGUAGE RankNTypes #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} |
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 LinearTypes #-} | |
| {-# LANGUAGE LambdaCase #-} | |
| {-# LANGUAGE BlockArguments #-} | |
| {-# LANGUAGE NoImplicitPrelude #-} | |
| {-# LANGUAGE QualifiedDo #-} | |
| import Prelude.Linear hiding (partition) | |
| import qualified Control.Functor.Linear as Linear | |
| import Control.Functor.Linear (State, state, execState, pure) | |
| import qualified Data.Array.Mutable.Linear as Array |
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 #-} | |
| {-# LANGUAGE TypeData #-} | |
| module Endofunctors where | |
| import Control.Comonad (Comonad(..)) | |
| import Control.Comonad.Cofree (Cofree(..)) | |
| import Control.Monad (join, ap, void) | |
| import Control.Monad.Free (Free(..)) | |
| import Data.Bifunctor (first, second, bimap) | |
| import Data.Functor.Day |
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 GHC2024, LinearTypes #-} | |
| module LinearClearBits where | |
| data With3 a b c where | |
| With3 :: x %1 -> (x %1 -> a) -> (x %1 -> b) -> (x %1 -> c) -> With3 a b c | |
| w1 :: With3 a b c %1 -> a | |
| w1 (With3 x f _ _) = f x | |
| w2 :: With3 a b c %1 -> b |
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 TypeFamilies #-} | |
| {-# LANGUAGE UndecidableInstances #-} | |
| {-# LANGUAGE AllowAmbiguousTypes #-} | |
| {-# LANGUAGE TypeApplications #-} | |
| {-# LANGUAGE ScopedTypeVariables #-} | |
| {-# LANGUAGE FlexibleContexts #-} | |
| {-# LANGUAGE EmptyCase #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| {-# LANGUAGE RankNTypes #-} | |
| module GenericArrow 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 GADTs #-} | |
| {-# LANGUAGE RankNTypes #-} | |
| {-# LANGUAGE DerivingStrategies #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| {-# LANGUAGE StandaloneDeriving #-} | |
| {-# LANGUAGE DeriveFunctor #-} | |
| module Phases where | |
| import Control.Applicative ((<**>)) | |
| import Data.Foldable (sequenceA_) |
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 | |
| TypeFamilies | |
| , KindSignatures | |
| , ScopedTypeVariables | |
| , ConstraintKinds | |
| , FlexibleInstances | |
| , FlexibleContexts | |
| , DeriveGeneric | |
| , DeriveAnyClass | |
| , TypeApplications |
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
| -- Inspired by the level-monad package by Sebastian Fischer | |
| module Lib | |
| ( search | |
| ) where | |
| import Data.Foldable (fold) | |
| import Data.Monoid (First(..)) | |
| newtype Levels m = Levels { levels :: [m] } |
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 BlockArguments #-} | |
| {-# LANGUAGE GADTs #-} | |
| {-# LANGUAGE LinearTypes #-} | |
| {-# LANGUAGE QualifiedDo #-} | |
| {-# LANGUAGE RankNTypes #-} | |
| {-# LANGUAGE TypeOperators #-} | |
| module Parallel where | |
| import Control.Concurrent (forkIO) |
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 TypeOperators #-} | |
| {-# LANGUAGE RankNTypes #-} | |
| {-# LANGUAGE DataKinds #-} | |
| {-# LANGUAGE PolyKinds #-} | |
| {-# LANGUAGE GADTs #-} | |
| module IndexedOptic where | |
| import Data.Kind (Type) | |
| type f ~> g = forall i. f i -> g i |
NewerOlder