Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Haskell example on landing page cut off on mobile #251

Closed
andys8 opened this issue Feb 3, 2023 · 5 comments
Closed

Haskell example on landing page cut off on mobile #251

andys8 opened this issue Feb 3, 2023 · 5 comments

Comments

@andys8
Copy link
Contributor

andys8 commented Feb 3, 2023

The example is not fully visible on my device (6.6 inch screen, but experience depending int he device).

I tried around, and 4 spaces are an improvement, but actually 2 spaces might be necessary with the current setup.

Are you open to using less than 6 spaces of indentation in the code?

Screenshot_2023-02-03-14-45-16-70_4d38fce200f96aeac5e860e739312e76

Record_2023-02-03-14-44-30.mp4
@tomjaguarpaw
Copy link
Collaborator

Are you open to using less than 6 spaces of indentation in the code?

Yeah absolutely. A PR to change to 2 spaces would be a good first step.

andys8 added a commit to andys8/www.haskell.org that referenced this issue Feb 3, 2023
@andys8
Copy link
Contributor Author

andys8 commented Feb 3, 2023

The original example is:

primes = filterPrime [2..]
      where filterPrime (p:xs) =
              p : filterPrime [x | x <- xs, x `mod` p /= 0]

The use of the where keyword constrains indentation a bit. One of these? Or do you have a different suggestion?

primes = filterPrime [2..]
  where
    filterPrime (p:xs) =
        p : filterPrime [x | x <- xs, x `mod` p /= 0]
primes = filterPrime [2..] where
  filterPrime (p:xs) =
    p : filterPrime [x | x <- xs, x `mod` p /= 0]

@tomjaguarpaw
Copy link
Collaborator

The last one seems fine and is most likely to fit.

(There's also talk of replacing the example with something more practical, but I don't think that should affect what we choose to do about spacing for now.)

@ulysses4ever
Copy link
Contributor

@andys8 where doesn't require more indentation after it, so this is legit too:

primes = filterPrime [2..]
  where
  filterPrime (p:xs) =
    p : filterPrime [x | x <- xs, x `mod` p /= 0]

But leaving it on the first line probably makes more sense.

@andys8
Copy link
Contributor Author

andys8 commented Feb 3, 2023

Solved via #254

@andys8 andys8 closed this as completed Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants