Skip to content

Instantly share code, notes, and snippets.

View oldfartdeveloper's full-sized avatar

Scott Smith oldfartdeveloper

View GitHub Profile
@oldfartdeveloper
oldfartdeveloper / CartesianProductExercise.md
Last active March 29, 2020 21:26
Cartesian product Exercise that I can't seem to get to compile on Purescript

Here's the code as part of a coding exercise (the 2nd one) here:

module CartesianProductExercise where
  
import Prelude

import Data.Tuple (Tuple(..))
@oldfartdeveloper
oldfartdeveloper / possibleSumsJourney.md
Last active May 28, 2020 05:26
Working a Purescript Exercise (sums)

Introduction

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.

The Exercise

Found in the Purescript Book, exercise 2:

(Medium) Write a function possibleSums which uses foldM 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: >

@oldfartdeveloper
oldfartdeveloper / .README.md
Last active November 30, 2021 16:05
PureScript: using newtype with records

PureScript: using newtype with records

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:

me

I have a compiler error that I'm just not understanding why it's happening: Here's the test code:

module Foo where