Code Monkey home page Code Monkey logo

data-lens-light's Introduction

data-lens-light's People

Contributors

andreasabel avatar bergmark avatar nanonaren avatar snoyberg avatar sorki avatar strake avatar unkindpartition avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

data-lens-light's Issues

Increase compatibility with Control.Lens

It would be nice to switch more easily from the lens package to your lightweight version.
For instance, you could add aliases to define the most basic lens applications, such as over, set, use.
Currently, if I want to switch, I have to create my own compatibility module.

For instance, here is a wrapper I needed for a small project:

module Lens
  ( module Data.Lens.Light
  , module Lens
  ) where

import Data.Lens.Light

over = modL
set  = setL
use  = access
_2   = lens snd $ \ y (x, _) -> (x, y)

Build failure with GHC 8

> /tmp/stackage-build8$ stack unpack data-lens-light-0.1.2.1
Unpacked data-lens-light-0.1.2.1 to /tmp/stackage-build8/data-lens-light-0.1.2.1/
> /tmp/stackage-build8/data-lens-light-0.1.2.1$ runghc -clear-package-db -global-package-db -package-db=/home/stackage/work/builds/nightly/pkgdb Setup configure --package-db=clear --package-db=global --package-db=/home/stackage/work/builds/nightly/pkgdb --libdir=/home/stackage/work/builds/nightly/lib --bindir=/home/stackage/work/builds/nightly/bin --datadir=/home/stackage/work/builds/nightly/share --libexecdir=/home/stackage/work/builds/nightly/libexec --sysconfdir=/home/stackage/work/builds/nightly/etc --docdir=/home/stackage/work/builds/nightly/doc/data-lens-light-0.1.2.1 --htmldir=/home/stackage/work/builds/nightly/doc/data-lens-light-0.1.2.1 --haddockdir=/home/stackage/work/builds/nightly/doc/data-lens-light-0.1.2.1 --flags=
Configuring data-lens-light-0.1.2.1...
> /tmp/stackage-build8/data-lens-light-0.1.2.1$ runghc -clear-package-db -global-package-db -package-db=/home/stackage/work/builds/nightly/pkgdb Setup build
Building data-lens-light-0.1.2.1...
Preprocessing library data-lens-light-0.1.2.1...
[1 of 4] Compiling Data.Lens.Light.Core ( src/Data/Lens/Light/Core.hs, dist/build/Data/Lens/Light/Core.o )
[2 of 4] Compiling Data.Lens.Light.Template ( src/Data/Lens/Light/Template.hs, dist/build/Data/Lens/Light/Template.o )

src/Data/Lens/Light/Template.hs:87:18: error:
    • The constructor ‘DataD’ should have 6 arguments, but has been given 5
    • In the pattern: DataD _ _ params cons' _
      In a case alternative:
          DataD _ _ params cons' _ -> return (params, cons')
      In a stmt of a 'do' block:
        (params, cons) <- case dec of {
                            DataD _ _ params cons' _ -> return (params, cons')
                            NewtypeD _ _ params con' _ -> return (params, [con'])
                            _ -> fail $ errmsg t }

Broken with mtl 2.2

And no upper bound ;)

[3 of 4] Compiling Data.Lens.Light.State ( src/Data/Lens/Light/State.hs, dist/dist-sandbox-8f6b8747/build/Data/Lens/Light/State.o )

src/Data/Lens/Light/State.hs:24:10:
    Ambiguous occurrence modify'
    It could refer to either Data.Lens.Light.State.modify',
                             defined at src/Data/Lens/Light/State.hs:40:1
                          or Control.Monad.State.modify',
                             imported from `Control.Monad.State' at src/Data/Lens/Light/State.hs:10:1-26
                             (and originally defined in `Control.Monad.State.Class')

src/Data/Lens/Light/State.hs:35:11:
    Ambiguous occurrence modify'
    It could refer to either Data.Lens.Light.State.modify',
                             defined at src/Data/Lens/Light/State.hs:40:1
                          or Control.Monad.State.modify',
                             imported from `Control.Monad.State' at src/Data/Lens/Light/State.hs:10:1-26
                             (and originally defined in `Control.Monad.State.Class')

Build failure with template-haskell-2.21 (GHC 9.8)

src/Data/Lens/Light/Template.hs:102:22: error: [GHC-83865]
    • Couldn't match type ‘BndrVis’ with ‘()’
      Expected: [TyVarBndr']
        Actual: [TyVarBndr BndrVis]
    • In the first argument of ‘makeAccs’, namely ‘params’
      In the first argument of ‘(.)’, namely ‘makeAccs params’
      In the first argument of ‘($)’, namely ‘makeAccs params . nub’
    |
102 |     decs <- makeAccs params . nub $ concatMap namedFields cons
    |                      ^^^^^^

I make a hackage revision to place bound template-haskell < 2.21: https://hackage.haskell.org/package/data-lens-light-0.1.2.3/revisions/

Lens composition order

Was there a reason for setting the composition order of lenses to 'right to left' rather than 'left to right' as used in the lens package? I don't particularly mind expect for when I feel like switching to and from the lens package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.