Do you really need such a huge number of cases?
I think the following should work:
mapNote : Note -> Int
mapNote note =
case note of
C -> 0
Db -> 1
D -> 2
Eb -> 3
E -> 4
F -> 5
Gb -> 6
G -> 7
Ab -> 8
A -> 9
Bb -> 10
B -> 11
noteToMIDINumber note =
case note of
(note,octave) -> (mapNote note) + (2+octave)*12
On Sun, May 29, 2016 at 4:16 AM Pablo Botelho <[email protected]> wrote:
> Hello folks, im trying to compile a module with a huge `case of`
> expression and my memory goes up until the computer freezes
>
> here is the code
>
> https://gist.github.com/pablobcb/6d6af87b627b3b7e432bd2b123bb8602
>
> would be better to create a data structure to avoid these issues?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>
--
You received this message because you are subscribed to the Google Groups "Elm
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.