commit
1288a421e2
6 changed files with 12 additions and 19 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -3,9 +3,11 @@
|
||||||
|
|
||||||
# CABAL
|
# CABAL
|
||||||
/dist
|
/dist
|
||||||
|
/dist-newstyle
|
||||||
/cabal-dev
|
/cabal-dev
|
||||||
/.cabal-sandbox
|
/.cabal-sandbox
|
||||||
/cabal.sandbox.config
|
/cabal.sandbox.config
|
||||||
|
.ghc.environment.*
|
||||||
|
|
||||||
# Haskell Program Coverage
|
# Haskell Program Coverage
|
||||||
/.hpc
|
/.hpc
|
||||||
|
|
|
@ -4,8 +4,8 @@ license: BSD3
|
||||||
license-file: LICENCE
|
license-file: LICENCE
|
||||||
author: Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ>
|
author: Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ>
|
||||||
maintainer: Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ>
|
maintainer: Tony Morris <ʇǝu˙sıɹɹoɯʇ@ןןǝʞsɐɥ>
|
||||||
copyright: Copyright (C) 2015-2016 National ICT Australia Limited
|
copyright: Copyright (C) 2015-2016 National ICT Australia Limited,
|
||||||
copyright: Copyright (c) 2017-2018, Commonwealth Scientific and Industrial Research Organisation (CSIRO) ABN 41 687 119 230.
|
Copyright (c) 2017-2018, Commonwealth Scientific and Industrial Research Organisation (CSIRO) ABN 41 687 119 230.
|
||||||
synopsis: Source code for exercises on the lens concept
|
synopsis: Source code for exercises on the lens concept
|
||||||
category: Education
|
category: Education
|
||||||
description: Source code for exercises on the lens concept
|
description: Source code for exercises on the lens concept
|
||||||
|
|
|
@ -16,7 +16,6 @@ module Lets.Data (
|
||||||
, Identity(..)
|
, Identity(..)
|
||||||
, AlongsideLeft(..)
|
, AlongsideLeft(..)
|
||||||
, AlongsideRight(..)
|
, AlongsideRight(..)
|
||||||
, bool
|
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Applicative(Applicative(..))
|
import Control.Applicative(Applicative(..))
|
||||||
|
@ -179,15 +178,3 @@ data AlongsideRight f a b =
|
||||||
instance Functor f => Functor (AlongsideRight f a) where
|
instance Functor f => Functor (AlongsideRight f a) where
|
||||||
fmap f (AlongsideRight x) =
|
fmap f (AlongsideRight x) =
|
||||||
AlongsideRight (fmap (\(a, b) -> (a, f b)) x)
|
AlongsideRight (fmap (\(a, b) -> (a, f b)) x)
|
||||||
|
|
||||||
----
|
|
||||||
|
|
||||||
bool ::
|
|
||||||
a
|
|
||||||
-> a
|
|
||||||
-> Bool
|
|
||||||
-> a
|
|
||||||
bool f _ False =
|
|
||||||
f
|
|
||||||
bool _ t True =
|
|
||||||
t
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ module Lets.GetSetLens (
|
||||||
, set
|
, set
|
||||||
, modify
|
, modify
|
||||||
, (%~)
|
, (%~)
|
||||||
|
, (.~)
|
||||||
, fmodify
|
, fmodify
|
||||||
, (|=)
|
, (|=)
|
||||||
, fstL
|
, fstL
|
||||||
|
|
|
@ -9,6 +9,7 @@ module Lets.OpticPolyLens (
|
||||||
, set
|
, set
|
||||||
, modify
|
, modify
|
||||||
, (%~)
|
, (%~)
|
||||||
|
, (.~)
|
||||||
, fmodify
|
, fmodify
|
||||||
, (|=)
|
, (|=)
|
||||||
, fstL
|
, fstL
|
||||||
|
|
|
@ -14,6 +14,7 @@ module Lets.StoreLens (
|
||||||
, set
|
, set
|
||||||
, modify
|
, modify
|
||||||
, (%~)
|
, (%~)
|
||||||
|
, (.~)
|
||||||
, fmodify
|
, fmodify
|
||||||
, (|=)
|
, (|=)
|
||||||
, fstL
|
, fstL
|
||||||
|
@ -28,6 +29,7 @@ module Lets.StoreLens (
|
||||||
, choice
|
, choice
|
||||||
, (|||)
|
, (|||)
|
||||||
, cityL
|
, cityL
|
||||||
|
, stateL
|
||||||
, countryL
|
, countryL
|
||||||
, streetL
|
, streetL
|
||||||
, suburbL
|
, suburbL
|
||||||
|
@ -51,7 +53,7 @@ import Data.Map(Map)
|
||||||
import qualified Data.Map as Map(insert, delete, lookup)
|
import qualified Data.Map as Map(insert, delete, lookup)
|
||||||
import Data.Set(Set)
|
import Data.Set(Set)
|
||||||
import qualified Data.Set as Set(insert, delete, member)
|
import qualified Data.Set as Set(insert, delete, member)
|
||||||
import Lets.Data(Store(Store), Person(Person), Locality(Locality), Address(Address), bool)
|
import Lets.Data(Store(Store), Person(Person), Locality(Locality), Address(Address))
|
||||||
import Prelude hiding (product)
|
import Prelude hiding (product)
|
||||||
|
|
||||||
-- $setup
|
-- $setup
|
||||||
|
|
Loading…
Reference in a new issue