Coder Social home page Coder Social logo

learnyouahaskell / learnyouahaskell.github.io Goto Github PK

View Code? Open in Web Editor NEW
250.0 9.0 30.0 2.23 MB

A community version of the renowned "Learn You a Haskell" (LYAH) tutorials collection!

Home Page: https://learnyouahaskell.github.io

License: Other

HTML 99.79% Shell 0.21%
learn-to-code haskell-tutorial programming-fundamentals haskell

learnyouahaskell.github.io's People

Contributors

bramdekker avatar dbp avatar guntbert avatar jackh3103 avatar jberryman avatar kephas avatar konsumlamm avatar learnyouahaskell avatar matthijsblom avatar mazharz avatar memowe avatar phuc1nguyen avatar profjanetdavis avatar pycub avatar samtygier avatar smith558 avatar tocic avatar xgpt avatar xogcox 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

learnyouahaskell.github.io's Issues

Use markdown sources

Thanks for all your effort in this important project!

I think it would be great to have the book‘s content as markdown files instead of HTML files:

Pros:

  1. It would make contributions much easier as it wouldn‘t require web authoring skills.
  2. It would make diffs much more readable.
  3. With pandoc and custom templates it would make exporting HTML, PDF or EPUB a very transparent process.

Cons:

  1. Lots of work. Especially when it‘s a requirement to produce (almost) the same HTML result as before.
  2. ...?

What do you think about it?

Starting out: triangle example: Text and code doesn't fit image

Is your content edit request related to a problem? Please describe.

I stumbled over the right triangle example in starting out: The text/code is not consistent with the image here

The image suggests (a) being the longer leg, the text/code has (b) be the longer leg.

Describe the solution you'd like

Changing the text/code is probably easier than changing the image?

Describe alternatives you've considered

I thought opening a PR but wasn't sure if this is a mistake at all or maybe if I'm mistaken - also, what's the best solution?

Additional context

(none)

Link to the page in question

The end of https://learnyouahaskell.github.io/starting-out.html from the pythag.png image and below.

"Monoids" is outdated

In: Functors, Applicative Functors and Monoids it described Monoids as having a minimal definition of mempty and mappend. Nowadays one has to define the Semigroup first and then define just mempty to create a Monoid. So people should not manually define mappend anymore. Perhaps a section on Semigroups can be created out of the existing sectiom for Monoids?

State monad + other monads defined in transformers are out of date

This is a pain point that I still remember from when I first learned Haskell using Learn You a Haskell probably almost 5 years ago.

Is your content edit request related to a problem? Please describe.

The definition of the State monad and probably most monads defined in transformers is outdated. See for example this code snippet; it no longer compiles with modern versions of Haskell/base/transformers because State has been redefined to be type State s a = StateT s Identity a:
https://github.com/learnyouahaskell/learnyouahaskell.github.io/blob/main/docs/for-a-few-monads-more.html#L1405-L1413

Describe the solution you'd like

The code snippet above should be modified to use the state function instead of the State constructor which no longer exists. Unfortunately this isn't a perfect solution because we maybe need to explain / at least somewhat excuse StateT / monad transformers before one really would want to pedagogically.

Describe alternatives you've considered

Encourage people to define the monad themselves and not import it in the examples. Then continue to use the older definition of the state monad throughout. This is maybe better, because it avoids the complications of monad transformers. If we go with this approach it might be a good idea to mention that

Additional context

This same problem also appears to affect at least Writer on the same page.

Link to the page in question

https://learnyouahaskell.github.io/for-a-few-monads-more.html#state

Problem with CSS on learnyouahaskell.com

Describe the bug
CSS style are not loaded on learnyouahaskell.com website.
You have <base href="http://learnyouahaskell.com/"> in HTML code. But website works over HTTPS. Because of that browser can't load http://learnyouahaskell.com/style.css and gives an error:

Mixed Content: The page at 'https://learnyouahaskell.com/functors-applicative-functors-and-monoids' was loaded over HTTPS, but requested an insecure stylesheet 'http://learnyouahaskell.com/style.css'. This request has been blocked; the content must be served over HTTPS.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'https://learnyouahaskell.com/functors-applicative-functors-and-monoids' using Chrome

Actual behavior
Screenshot 2024-01-31 at 09 51 43

Desktop (please complete the following information):

  • OS: MacOS
  • Browser: Chrome
  • Version: 120

Bad layout on mobile

Describe the bug
The layout is too narrow on mobile.

  • The vertical colored bands could be removed
  • links at the bottom of the page are too small

To Reproduce

Browse the content with a mobile

Expected behavior
Screen space is not wasted

Smartphone (please complete the following information):

  • Device: Huway P30
  • OS: Android
  • Browser Firefox

Prelude folds now apply to any Foldable

Related to #49, Prelude folds nowadays can fold on any Foldable so the entire sub-section of Monoids titled "Using monoids to fold data structures" which describes needing to import folds from Foldable in order to do so is out of date. Also, this sub-section on foldM uses the outdated datatype for folds too.

Google and other browser-enabled translators modify the code to translate it

Describe the bug
Google and other browser-enabled translators modify the code to translate it

To Reproduce
Steps to reproduce the behavior:

  1. Go to any page with code snippets
  2. Click on "Translate this page"
  3. Change the language
  4. Observe that the code snippets have been modified (translated).

Expected behavior
The code snippets should not be translated.

Additional context
This issue can be fixed by using the translate="no" attribute on the code snippet containers.

<div class="dp-highlighter nogutter" translate="no">
...
</div>

This code snippet may fix the problem, but the highlight library should highlight the code first.

document.querySelectorAll('.dp-highlighter').forEach(it => it.setAttribute('translate', 'no'))

I've tried to fix it myself, but I haven't figured out how to make it work properly.

Thanks for cool design :)

Example for "ambiguous type variable" error doesn't work anymore

Chapter 3 has an example that read "4" produces an "ambiguous type variable" error. However, this is not the case anymore, since GHCi disables the MonomorphismRestriction, it now throws a "no parse" exception. The problem is that this is used to explain how to specify a type with an explicit type annotation.

I think the easiest solution would be to simply put the definition in a file. Can you think of a better solution?

State monad

Is your content edit request related to a problem? Please describe.

Some of the state monad stuff doesnlt comiple as State is not exported from Control.Monad.State

Describe the solution you'd like
state in lower case:

type Stack = [Int]

pop :: State Stack Int  
pop = state $ \(x:xs) -> (x,xs)  
  
push :: Int -> State Stack ()  
push a = state $ \xs -> ((),a:xs)  

Additional context

https://stackoverflow.com/questions/9697980/the-state-monad-and-learnyouahaskell-com
Link to the page in question

https://learnyouahaskell.github.io/for-a-few-monads-more.html#state

Images on Amazon AWS

Some images seem to be included in docs, but many are still linked to amazonaws.com. I think it would be a good idea to include the complete artwork in the repository. Are there any legal/copyright issues preventing us from doing so?

If not, I could help with that. :)

Replace Comments about BMI

The syntax-in-functions page includes a BMI example that may benefit from being rewritten. The two options I'm aware of would be:

  • Keeping using BMI as the example, but change the messages for different categories
  • Change the example to something else that uses division, perhaps calculating speed from distance and time, and then it would be possible to provide silly messages that aren't about a sensitive issue.

I prefer the second option because I think it would just be best to avoid discussing BMI. I am happy to put together a PR if the maintainer agrees.

EPUB version?

This is awesome, thank you for starting this project.

I know it's early, but is there any chance for an EPUB version that I can put on my e-reader?

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.