Git Product home page Git Product logo

haskell-book's Introduction

Haskell Programming from First Principles

Solutions to the exercises from the book "Haskell Programming from First Principles" by Christopher Allen and Julie Moronuki.

Book available for purchase here: http://haskellbook.com/

haskell-book's People

Stargazers

Dylan M. avatar William Liu avatar Jason avatar  avatar Ayush Pandey avatar Bradford Eaton PhD avatar monika avatar Megha Verma avatar Mr. Daring avatar Oleksandr avatar Tim Weijers avatar Javier Pérez Arteaga avatar Rock Boynton avatar Ravi Dayabhai avatar Amr Almorsi avatar Nikos Gereoudakis avatar  avatar  avatar  avatar Nicky García avatar Li.Zhixiong avatar Jonathan Castro avatar  avatar  avatar Mohammad avatar  avatar  avatar Timo Klingler avatar  avatar  avatar  avatar ╯‵Д′)╯彡┻━┻ (☕1e6) avatar Sureymi Tumah avatar foresightyj avatar  avatar Marc Berkowitz avatar  avatar Libardo Abella avatar overflow avatar evanthechong avatar Alexei Vinidiktov avatar klequis avatar  avatar  avatar manolo avatar scientia avatar Azizul Karim avatar  avatar Lateef Alabi-Oki avatar Nyakeh Konneh avatar Marcus Nölke avatar Evgeny Pogrebnyak avatar Andrei A avatar  avatar Torsten Curdt avatar Spencer Stewart avatar david harvey avatar Nissi Nassime avatar Juan Marín avatar  avatar Yves Amevoin avatar Alex Nuttall avatar Jack O'Brien avatar fengxh avatar Jay Jang avatar AhaXu avatar C.H. Yang avatar Nobu Kim-Toyoda avatar Fernando Basso avatar Yang Mao avatar  avatar Damian Jóźwiak avatar  avatar Jaime Santos avatar George Essig avatar Robert Armenski avatar  avatar Oliver Tosky avatar Florian Peter avatar Martin Tovmassian avatar Udi Finkelstein avatar Kyrylo Taran avatar Tohid Heshmati avatar Tony Seing avatar  avatar Blanqui avatar Rodrigo Juarez avatar Robel  avatar

Watchers

Antony Agrios avatar James Cloos avatar Martín Valdés de León avatar Tohid Heshmati avatar  avatar Nissi Nassime avatar

haskell-book's Issues

Chapter 9 cipher code doesn't work

The cipher code doesn't cycle around the letters when for example "zZ" is inputted as the string: it instead goes to the next unicode letters.

While a function using ord/chr and mods is feasible, I instead just used a recursive function that used a large number of guard blocks:

enumCipher :: String -> Int -> String
enumCipher str shift
  | shift < 0  = enumCipher str (mod (26 - shift) 26)
  | shift > 26 = enumCipher str (mod shift 26)
  | shift == 0 = str
  | otherwise  = enumCipher (map shiftFunc str) (shift - 1)
  where shiftFunc chr
          | chr == 'z'  = 'a'
          | chr == 'Z'  = 'A'
          | otherwise   = succ chr

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.