Coder Social home page Coder Social logo

glambda's People

Contributors

ajnsit avatar goldfirere avatar jrp2014 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

glambda's Issues

Solutions to Exercises

I remember attending this talk about a year ago, very cool! I'm currently trying to represent SQL expressions in Haskell and I have a hunch that GADT's could help. I'm trying to brush up on GADT's and I was wondering if the solutions to the exercises are available anywhere.

Thanks!

Make Val injective

Val from Exp.hs is a lovely thing to mark injective (and it looks very nice with instance sigs)

{-# Language TypeFamilyDependencies #-}
{-# Language InstanceSigs #-}

class GlamVal t where
  type Val t = res | res -> t

  val :: Val t -> Exp '[] t

instance GlamVal Int where
  type Val Int = Int

  val :: Int -> Exp '[] Int
  val = IntE 

instance GlamVal Bool where
  type Val Bool = Bool

  val :: Bool -> Exp '[] Bool
  val = BoolE 

instance GlamVal (a -> b) where
  type Val (a -> b) = Exp '[a] b

  val :: Exp '[a] b -> Exp '[] (a -> b)
  val = Lam 

the val instances become even more basic, it also removes clutter throughout other modules.

Upload a new version to Hackage

glambda-1.0.1 (the latest version on Hackage) no longer compiles after the release of either-5:

$ cabal install glambda
Resolving dependencies...
Configuring glambda-1.0.1...
Building glambda-1.0.1...
Failed to install glambda-1.0.1
Build log ( /home/ryanglscott/.cabal/logs/ghc-8.2.2/glambda-1.0.1-KIdxe1fpIpCAdChAXWfgZ.log ):
cabal: Entering directory '/tmp/cabal-tmp-19074/glambda-1.0.1'
Configuring glambda-1.0.1...
Preprocessing library for glambda-1.0.1..
Building library for glambda-1.0.1..
[ 1 of 15] Compiling Language.Glambda.Util ( src/Language/Glambda/Util.hs, dist/build/Language/Glambda/Util.o )
[ 2 of 15] Compiling Language.Glambda.Type ( src/Language/Glambda/Type.hs, dist/build/Language/Glambda/Type.o )
[ 3 of 15] Compiling Language.Glambda.Token ( src/Language/Glambda/Token.hs, dist/build/Language/Glambda/Token.o )
[ 4 of 15] Compiling Language.Glambda.Pretty ( src/Language/Glambda/Pretty.hs, dist/build/Language/Glambda/Pretty.o )
[ 5 of 15] Compiling Language.Glambda.Unchecked ( src/Language/Glambda/Unchecked.hs, dist/build/Language/Glambda/Unchecked.o )
[ 6 of 15] Compiling Language.Glambda.Statement ( src/Language/Glambda/Statement.hs, dist/build/Language/Glambda/Statement.o )
[ 7 of 15] Compiling Language.Glambda.Exp ( src/Language/Glambda/Exp.hs, dist/build/Language/Glambda/Exp.o )
[ 8 of 15] Compiling Language.Glambda.Shift ( src/Language/Glambda/Shift.hs, dist/build/Language/Glambda/Shift.o )
[ 9 of 15] Compiling Language.Glambda.Globals ( src/Language/Glambda/Globals.hs, dist/build/Language/Glambda/Globals.o )
[10 of 15] Compiling Language.Glambda.Monad ( src/Language/Glambda/Monad.hs, dist/build/Language/Glambda/Monad.o )

src/Language/Glambda/Monad.hs:37:1: error:
    Could not find module ‘Control.Monad.Trans.Either’
    Perhaps you meant
      Control.Monad.Trans.Writer (from transformers-0.5.2.0)
      Control.Monad.Trans.Error (from transformers-0.5.2.0)
      Control.Monad.Trans.Reader (from transformers-0.5.2.0)
    Use -v to see a list of the files searched for.
   |
37 | import Control.Monad.Trans.Either
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cabal: Leaving directory '/tmp/cabal-tmp-19074/glambda-1.0.1'
cabal: Error: some packages failed to install:
glambda-1.0.1-KIdxe1fpIpCAdChAXWfgZ failed during the building phase. The
exception was:
ExitFailure 1

This is because either-5 removed Control.Monad.Trans.Either in favor of Control.Monad.Trans.Except from transformers.

It looks like glambda HEAD has already accommodated this change in 6cb06f6, but this hasn't made it to Hackage yet. Can you upload a new version to fix this?

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.