Giter Club home page Giter Club logo

haskus-manual's People

Contributors

hsyl20 avatar jmazon avatar monadict avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

haskus-manual's Issues

newtype -> data

Here,

newtype ConsF a e = ConsF a e deriving (Functor)
newtype NilF    e = NilF      deriving (Functor)

should use data, not newtype.

Otherwise:

* The constructor of a newtype must have exactly one field
        but `ConsF' has two

Are the docs up to date?

I like the library very much and the documentation is a big help getting started. Huge thanks for that. While trying out some sample code from the docs, I have encountered some typecheck errors. One example is,

class MyShow e where
  myShow :: e -> String

instance MyShow (NilF e) where
  myShow _ = "Nil"

instance (MyShow e, Show a) => MyShow (ConsF a e) where
  myShow (ConsF a l) = show a ++ " : " ++ myShow l

instance MyShow (f (EADT f)) => MyShow (EADT f) where
  {-# INLINE myShow #-}
  myShow (EADT e) = myShow e

The MyShow instance declaration for EADT throws errors.

src/Dep2.hs:172:26: error: …
    • Expecting one more argument to ‘f’
      Expected kind ‘[* -> *]’, but ‘f’ has kind ‘* -> *’
    • In the first argument of ‘EADT’, namely ‘f’
      In the first argument of ‘f’, namely ‘(EADT f)’
      In the first argument of ‘MyShow’, namely ‘(f (EADT f))’
    |

I am using haskus-utils-variant-3.1, haskus-utils-data-1.4, and haskus-utils-types-1.5. Wondering if the docs are in sync with the code.

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.