Here's the code as part of a coding exercise (the 2nd one) here:
module CartesianProductExercise where
import Prelude
import Data.Tuple (Tuple(..))
Here's the code as part of a coding exercise (the 2nd one) here:
module CartesianProductExercise where
import Prelude
import Data.Tuple (Tuple(..))
This exercise shouldn't have been that challenging, but it stumped me. Here's my woeful journey with the path through it so that I can review my approach when I get stuck on the next exercise.
Found in the Purescript Book, exercise 2:
(Medium) Write a function
possibleSums
which usesfoldM
to determine all possible totals that could be made using a set of coins. The coins will be specified as an array which contains the value of each coin. Your function should have the following result: >
I ran into a beginner mistake that I was unable to figure out. So I posted to PureScript Discord and the conversation quickly showed me not only why what I did didn't work, but suggestions for how to fix it specifically. Kudos to @monoidmusician and @natefabion. Here's the discussion:
I have a compiler error that I'm just not understanding why it's happening: Here's the test code:
module Foo where