Giter VIP home page Giter VIP logo

up-to-date-real-world-haskell's Issues

Add CONTRIBUTING

Sorry, I didn't know how else to contact you. It would be great if there was a way to contribute. I for one, am interested. :-)

Some Problems in Chapter 14

I follow the codes in chapter 14 and find some little problems.

  1. charClass_wordy defined but not used, I think maybe the charClass function should be modified as following:
charClass (']':cs) = (']':) <$> globToRegex' cs
charClass (c:cs) = (c:) <$> charClass_wordy cs
  1. According to monad fail, from GHC 8.8+, the fail function will not be supported. I suggest change the fail function to error or other implementation.

  2. charClass_wordy also lacks a matching form, which should be added as follows:

charClassWordy "" = 
    error "No more input"

Integer literals are now inferred as `Num`

This is from Chapter 1, "Getting Started":

ghci> 7 ^ 80
40536215597144386832065866109016673800875222251012083746192454448001
it :: Integer

But with latest ghc, we get:

ghci> 7 ^ 80
40536215597144386832065866109016673800875222251012083746192454448001
it :: Num a => a

I couldn't figure out how to rewrite that section and also preserve the lesson about Integer.

Lets track it here for now.

Update to GHC > 8.4.x

  • Explain DerivingVia instead of GeneralizedNewtypeDeriving
  • Remove Functor and Applicative instances boilerplate

Fix the style of every code sample

  • Fix snake_case identifiers
  • Use CamelCase for all filenames
  • Use point-free style whenever possible after it is explained
  • Use 2 spaces for indentation

[SOLVED] Chapter 6 is mentioning an error which no longer occurs

In "Chapter 6: Using Type Classes" at "The dreaded monomorphism restriction" it states that the following code results in an error.

myShow = show

But in ghci I get no error

GHCi, version 8.10.2: https://www.haskell.org/ghc/  :? for help
Prelude> myShow = show
Prelude>

Content missing in webpage preview

Hi,
I was reading Chapter 6: Using Type Classes. I found several lines missing (for the declaration of UniqueId was unclear):

screenshot

However, as I looked into the source, these lines are still there:


#+BEGIN_NOTE
The type and newtype keywords

Although their names are similar, the ~type~ and ~newtype~
keywords have different purposes. The ~type~ keyword gives us
another way of referring to a type, like a nickname for a friend.
Both we and the compiler know that ~[Char]~ and ~String~ names
refer to the same type.

In contrast, the ~newtype~ keyword exists to /hide/ the nature of
a type. Consider a ~UniqueID~ type.

#+CAPTION: Newtype.hs
#+BEGIN_SRC haskell
newtype UniqueID = UniqueID Int
    deriving (Eq)
#+END_SRC

The compiler treats ~UniqueID~ as a different type from ~Int~. As
a user of a ~UniqueID~, we know only that we have a unique
identifier; we cannot see that it is implemented as an ~Int~.
#+END_NOTE

Perhaps this is a problem, but I am not sure at which level it arises.

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.