learnyouahaskell / learnyouahaskell.github.io Goto Github PK
View Code? Open in Web Editor NEWA community version of the renowned "Learn You a Haskell" (LYAH) tutorials collection!
Home Page: https://learnyouahaskell.github.io
License: Other
A community version of the renowned "Learn You a Haskell" (LYAH) tutorials collection!
Home Page: https://learnyouahaskell.github.io
License: Other
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:
Cons:
What do you think about it?
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.
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?
The section "The Monad type class" in the chapter "A Fistful of Monads" (https://learnyouahaskell.github.io/a-fistful-of-monads.html#the-monad-type-class) talks about how Applicative
is not a superclass of Monad
. However, that is not true anymore. Additionally, fail
is no longer a method of Monad
.
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.
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
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.
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
This same problem also appears to affect at least Writer
on the same page.
https://learnyouahaskell.github.io/for-a-few-monads-more.html#state
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:
Desktop (please complete the following information):
Describe the bug
The layout is too narrow on mobile.
To Reproduce
Browse the content with a mobile
Expected behavior
Screen space is not wasted
Smartphone (please complete the following information):
I would like all of the images anti-aliased with transparency so that they look good on a dark background.
I would use those for https://github.com/jamesdbrock/learn-you-a-haskell-notebook
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.
Describe the bug
Google and other browser-enabled translators modify the code to translate it
To Reproduce
Steps to reproduce the behavior:
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 :)
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?
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
The What you need to dive in section in the introduction currently recommends downloading the Haskell Platform. However, the Haskell Platform is deprecated and it is recommended to use GHCup instead, so the section should be updated.
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. :)
The syntax-in-functions
page includes a BMI example that may benefit from being rewritten. The two options I'm aware of would be:
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.
@ https://learnyouahaskell.github.io/input-and-output.html#exceptions
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.