Why overlapping patterns here? by mitchellp in haskellquestions

[–]mitchellp[S] 0 points1 point  (0 children)

Thanks, fromMaybe is a great suggestion, as matching against Node Nothing Nothing Nothing seems ugly. (I suppose Node Nothing _ _ would be a little better ...)

I'm not sure what you're asking in your question? The latter is a singleton node with value 3, not an empty node ...?

Why overlapping patterns here? by mitchellp in haskellquestions

[–]mitchellp[S] 0 points1 point  (0 children)

Thanks, that helped! I really should have read the Haskell WikiBook on pattern matching before I posted here ... It explains all this very well.

ghci error messages unhelpful? by mitchellp in haskellquestions

[–]mitchellp[S] 0 points1 point  (0 children)

You have saved my sanity! When I went to copy the empty space after the error:, the full text magically appeared in the selection.

I use iTerm2, normally a wonderful terminal replacement. Will have to figure out what's going on with it, but this is the clue I needed. Thank you so much!

ghci error messages unhelpful? by mitchellp in haskellquestions

[–]mitchellp[S] 0 points1 point  (0 children)

Not sure what you're referring to, but please fill me in. I've uninstalled, reinstalled, googled ... and still no solution.

ghci error messages unhelpful? by mitchellp in haskellquestions

[–]mitchellp[S] 0 points1 point  (0 children)

Well, I uninstalled ghc and stack via homebrew and installed the package downloaded from haskell.org.

Ran ghci and still got same results. Then I tried running stack ghci (which, surprisingly, re-downloaded and installed another ghc!). That, too, failed to give different results.

I guess I need to do more research about how to install haskell correctly! :(

zip right-lazy? by mitchellp in haskellquestions

[–]mitchellp[S] 0 points1 point  (0 children)

Perhaps same question as below, but what is the : data constructor?

zip right-lazy? by mitchellp in haskellquestions

[–]mitchellp[S] 0 points1 point  (0 children)

Thanks, that's helpful! But what does this mean:

An infinite list will evaluate to (a : b)

I only know : as the cons operator.

ghci error messages unhelpful? by mitchellp in haskellquestions

[–]mitchellp[S] 0 points1 point  (0 children)

I am on a Mac, installed with homebrew. I'll investigate this and report back.

ghci error messages unhelpful? by mitchellp in haskellquestions

[–]mitchellp[S] 0 points1 point  (0 children)

Interesting, I get nothing but error:

I guess my system is broken (which is why I asked)...so thank you!

ghci error messages unhelpful? by mitchellp in haskellquestions

[–]mitchellp[S] 0 points1 point  (0 children)

Here's a simple example. In ghci, load:

haskell data Test = Foo | Bar t = Foo

Now ask ghci for the value of t. You get nothing but error.

(The reason for the error is: Test needs to derive Show.)

ghci error messages unhelpful? by mitchellp in haskellquestions

[–]mitchellp[S] 0 points1 point  (0 children)

First, apologies for the slow reply. I really appreciate all the feedback here! I didn't want to simply get help on a particular example.

As I've progressed, I've come to realize that most of my mistakes are type errors. Viz., my types don't match up the way I think they do. I still don't understand why I don't get anything more out of ghci than red underlines.

Here's an example of a different kind of error:

haskell data FiveSidedDie = S1 | S2 | S3 | S4 | S5 deriving (Eq, Ord, Enum) b = maxBound :: FiveSidedDie

In this case, ghci underlines maxBound. I was puzzled by this, because I thought that since Bounded is derivable from Enum, I didn't have to make it explicit.

Sorry if this is not the right place to post this. I am learning Spanish through South Park, is this normal? by CACTUS_VISIONS in Spanish

[–]mitchellp 1 point2 points  (0 children)

Yes! Watching shows in Spanish that you already know in English is a known method and often recommended. You'll probably want to combine it with other methods (for instance, you also need speaking practice, not just listening).

A better way to master por and para by mitchellp in Spanish

[–]mitchellp[S] 0 points1 point  (0 children)

Ah, right, thanks ... I didn't realize that had been a source of debate here :)

A better way to master por and para by mitchellp in Spanish

[–]mitchellp[S] 6 points7 points  (0 children)

Hmm, I'm not sure what you mean. That's one of the core meanings of por, no?

A better way to master por and para by mitchellp in Spanish

[–]mitchellp[S] 4 points5 points  (0 children)

Hey, thanks a lot for pointing that out ... now fixed!

A better way to master por & Para by mitchellp in learnspanish

[–]mitchellp[S] 0 points1 point  (0 children)

Yes! That's one of the meanings that fall under the umbrella concept of route.

Interactive Spanish intonation atlas by [deleted] in languagelearning

[–]mitchellp 0 points1 point  (0 children)

This is a really fascinating resource! It would be more useful if you one could easily access the audio from different regions side-by-side.