Giter Site home page Giter Site logo

cradle's People

Contributors

bryant1410 avatar g-ford 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

cradle's Issues

Small bugs in the haskell code snippets

In the "Single Digit Math" Chapter:

  1. Section "A Single Digit" (first code snippet):
    module Data.Char should be replaced with
    import Data.Char.
  2. Section "Adding Types":
    The data type has a terminal type Num Int, but it is instantiated with a Char in isDigit x = Num x.
    Either change the Num Int to Num Char or construct it with the ordinal value of the character: isDigit x = Num ((ord x)-(ord '0'))

Maybe not that important in general, but for someone not proficient in haskell like me, it took a while to find why the codes are not compiling.

Error in code snippet - Chapter Single Digit Math

function created to compute expression :
expression (x:y:z:[]) = (term x) ++ (addOperation y) ++ (term z)

shows a type error

    • Couldn't match expected type ‘[Char]’ with actual type ‘Char’
    • In the second argument of ‘(++)’, namely ‘(term z)’
      In the second argument of ‘(++)’, namely
        ‘(addOperation y) ++ (term z)’
      In the expression: (term x) ++ (addOperation y) ++ (term z)
   |
17 | expression (x:y:z:[]) = (term x) ++ (addOperation y) ++ (term z)
   |                                                          ^^^^^^

Possible but immature(imo) solution(or hack) that I came up with is
expression (x:y:z:[]) = (term x : []) ++ (addOperation y) ++ (term z : [])

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.