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 RecordWildCards, PatternGuards, ViewPatterns #-} | |
| module Cabal(run, readCabal, extractCabal) where | |
| import Control.Monad.Extra | |
| import Control.Exception.Extra | |
| import Data.Char | |
| import Data.List.Extra | |
| import Data.Maybe | |
| import Data.Functor |
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
| -- | Traverse the structure using the traversal but memoize the | |
| -- results of the transforming function; this means that the function | |
| -- is called once for every unique element. | |
| -- | |
| -- NB: I can't work out how to do this with only one optic argument, | |
| -- but it should be possible. | |
| -- | |
| -- prop> traverseNubOf (traverse._1) (traverse._1) (\x -> do print x; return (-x)) [(2,10),(2,20),(1,30),(1,40),(3,50),(3,60)] | |
| -- 1 | |
| -- 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
| > {-# LANGUAGE Rank2Types #-} | |
| > | |
| > import Prelude hiding (id) | |
| > import Data.Functor.Constant (Constant(Constant), getConstant) | |
| > import Control.Arrow (Arrow, arr, first, Kleisli(Kleisli), runKleisli, (&&&)) | |
| > import Control.Category ((<<<)) | |
| > import Control.Lens (sequenceAOf) | |
| > import qualified Control.Lens as L | |
| > import qualified Control.Lens.Internal.Setter as LS | |
| > import Data.Profunctor (Profunctor, rmap) |
NewerOlder