Logs: liberachat/#haskell
| 2021-06-14 10:16:54 | <tomsmeding> | teaSlurper: ah right, that Any is ghc saying I have no idea what this should be |
| 2021-06-14 10:17:40 | <tomsmeding> | had you replaced that Any with Octave, or equivalently Int, it should have worked |
| 2021-06-14 10:17:46 | <teaSlurper> | ok cool, thx. i'm new to haskell so it's all a bit fuzzy at the mo, but i have a general idea |
| 2021-06-14 10:18:00 | <teaSlurper> | oh cool |
| 2021-06-14 10:18:01 | <tomsmeding> | because Pitch = (PitchClass, Octave) |
| 2021-06-14 10:18:20 | <teaSlurper> | that does make sense |
| 2021-06-14 10:18:27 | <teaSlurper> | have you used Euterpea? |
| 2021-06-14 10:18:40 | <tomsmeding> | no, I just did https://github.com/Euterpea/Euterpea2/search?q=Pitch :p |
| 2021-06-14 10:19:02 | <teaSlurper> | coolzies |
| 2021-06-14 10:19:11 | <teaSlurper> | quick search |
| 2021-06-14 10:20:13 | → | eggplantade joins (~Eggplanta@2600:1700:bef1:5e10:b9b1:9fc2:289f:a533) |
| 2021-06-14 10:20:21 | <teaSlurper> | i'm learning haskell for my msc dissertation based on computer music, i hear haskell is used quite a bit in that field |
| 2021-06-14 10:20:35 | <teaSlurper> | going through a haskell book called "school of music" |
| 2021-06-14 10:20:51 | <teaSlurper> | to learn both music theory and haskell simultaneously |
| 2021-06-14 10:20:57 | <tomsmeding> | cool stuff! I know of at least one other person using haskell for computer music, but I'm really not in that scene |
| 2021-06-14 10:21:14 | <tomsmeding> | though I know both music and haskell, so perhaps I should change that :p |
| 2021-06-14 10:21:35 | × | thyriaen quits (~thyriaen@45.178.75.13) (Read error: No route to host) |
| 2021-06-14 10:21:42 | <DigitalKiwi> | teaSlurper: plz let me know how you like that one i've had it on my list for ages heh |
| 2021-06-14 10:21:49 | <teaSlurper> | cool, fair play. i'll give myself rest of june to see how far i get, that worst case scenario i'll pivot to JavaScript and use webAudio |
| 2021-06-14 10:22:22 | <teaSlurper> | DigitalKiwi: ye sure, on chapter 2 now |
| 2021-06-14 10:22:38 | fendor_ | is now known as fendor |
| 2021-06-14 10:23:31 | <teaSlurper> | lazy evaluation and infix operations and recursion seem useful for music composition, but these concepts are very new to me |
| 2021-06-14 10:23:37 | <teaSlurper> | operators* |
| 2021-06-14 10:23:57 | <teaSlurper> | can express things with less code in haskell i guess |
| 2021-06-14 10:24:20 | <tomsmeding> | that tends to be true in general with haskell, for a surprising number of purposes |
| 2021-06-14 10:24:44 | × | eggplantade quits (~Eggplanta@2600:1700:bef1:5e10:b9b1:9fc2:289f:a533) (Ping timeout: 244 seconds) |
| 2021-06-14 10:25:02 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 272 seconds) |
| 2021-06-14 10:25:05 | <DigitalKiwi> | there are some hear who don't even write code they merely import their libraries |
| 2021-06-14 10:25:30 | <tomsmeding> | that's more like python, right? |
| 2021-06-14 10:25:45 | <teaSlurper> | in js/java i guess a recursive melody would crash or stack overflow at runtime, i guess haskell's lazy evaluation is what stops it crashing? |
| 2021-06-14 10:25:52 | tomsmeding | . o O ( https://xkcd.com/353/ ) |
| 2021-06-14 10:26:16 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-06-14 10:26:34 | <tomsmeding> | teaSlurper: that sounds accurate enough |
| 2021-06-14 10:26:46 | <DigitalKiwi> | it is said that edwardk can solve any problem with 1 line of code and a vast number of imports |
| 2021-06-14 10:26:59 | <tomsmeding> | depending I guess on exactly what you mean with "recursive melody" |
| 2021-06-14 10:27:15 | <tomsmeding> | DigitalKiwi: can that line include ; |
| 2021-06-14 10:27:27 | <DigitalKiwi> | i'll allow it |
| 2021-06-14 10:27:37 | <teaSlurper> | a function that just calls itself for ever adding more notes and then sending that to a function to play |
| 2021-06-14 10:27:41 | × | dunkeln quits (~dunkeln@94.129.65.28) (Ping timeout: 252 seconds) |
| 2021-06-14 10:28:02 | <teaSlurper> | you don't have to specific an end point |
| 2021-06-14 10:28:05 | <tomsmeding> | > let x = 1 : x in x |
| 2021-06-14 10:28:06 | <teaSlurper> | specify* |
| 2021-06-14 10:28:07 | <lambdabot> | [1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1... |
| 2021-06-14 10:28:53 | <teaSlurper> | cool |
| 2021-06-14 10:29:34 | <teaSlurper> | i could define a recursive function that adds random notes to itself (an array) and then just that to a play function i guess |
| 2021-06-14 10:29:44 | <teaSlurper> | just send that* |
| 2021-06-14 10:29:47 | <tomsmeding> | s/array/list/, but yes |
| 2021-06-14 10:29:48 | <teaSlurper> | or parse |
| 2021-06-14 10:30:13 | <DigitalKiwi> | https://clrnd.com.ar/posts/2017-04-21-the-water-jug-problem-in-hedgehog.html |
| 2021-06-14 10:30:56 | × | xff0x_ quits (~xff0x@2001:1a81:5219:ab00:f769:e02a:3ef8:6355) (Ping timeout: 244 seconds) |
| 2021-06-14 10:31:52 | → | xff0x_ joins (~xff0x@2001:1a81:5219:ab00:108a:2215:f051:17c7) |
| 2021-06-14 10:33:16 | × | juhp quits (~juhp@128.106.188.66) (Quit: juhp) |
| 2021-06-14 10:33:23 | ← | jakalx parts (~jakalx@base.jakalx.net) (Error from remote client) |
| 2021-06-14 10:35:10 | → | oxide joins (~lambda@user/oxide) |
| 2021-06-14 10:36:06 | × | azeem quits (~azeem@dynamic-adsl-78-13-238-239.clienti.tiscali.it) (Ping timeout: 244 seconds) |
| 2021-06-14 10:36:49 | → | azeem joins (~azeem@176.201.21.98) |
| 2021-06-14 10:36:54 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 264 seconds) |
| 2021-06-14 10:37:45 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-06-14 10:38:06 | <kuribas> | would generics-eot be understandable by a beginner? |
| 2021-06-14 10:38:10 | × | cfricke quits (~cfricke@user/cfricke) (Ping timeout: 244 seconds) |
| 2021-06-14 10:38:20 | × | bpalmer quits (~user@user/bpalmer) (Remote host closed the connection) |
| 2021-06-14 10:38:26 | <kuribas> | https://hackage.haskell.org/package/generics-eot-0.4.0.1/docs/Generics-Eot.html |
| 2021-06-14 10:38:33 | → | bpalmer joins (~user@user/bpalmer) |
| 2021-06-14 10:39:17 | → | cfricke joins (~cfricke@user/cfricke) |
| 2021-06-14 10:43:05 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 252 seconds) |
| 2021-06-14 10:43:24 | → | ddellacosta joins (~ddellacos@89.45.224.126) |
| 2021-06-14 10:43:34 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2021-06-14 10:45:26 | → | pkkm2 joins (~pkkm@dgs4.neoplus.adsl.tpnet.pl) |
| 2021-06-14 10:46:52 | ← | pkkm2 parts (~pkkm@dgs4.neoplus.adsl.tpnet.pl) () |
| 2021-06-14 10:48:28 | × | ddellacosta quits (~ddellacos@89.45.224.126) (Ping timeout: 272 seconds) |
| 2021-06-14 10:49:15 | × | cfricke quits (~cfricke@user/cfricke) (Ping timeout: 268 seconds) |
| 2021-06-14 10:50:05 | → | Schrostfutz_ joins (~Schrostfu@p5de88aa6.dip0.t-ipconnect.de) |
| 2021-06-14 10:50:31 | → | cfricke joins (~cfricke@user/cfricke) |
| 2021-06-14 10:50:38 | <Schrostfutz_> | Hi, I saw a way to reverse the dot notation of function composition to make it a bit more readable, can someone remind me how that's done? |
| 2021-06-14 10:51:06 | <tomsmeding> | :t Data.Function.(&) |
| 2021-06-14 10:51:08 | <lambdabot> | error: |
| 2021-06-14 10:51:08 | <lambdabot> | Not in scope: data constructor ‘Data.Function’ |
| 2021-06-14 10:51:08 | <lambdabot> | Perhaps you meant one of these: |
| 2021-06-14 10:51:35 | → | haskman joins (~haskman@171.61.149.211) |
| 2021-06-14 10:51:36 | <tomsmeding> | % import Data.Function |
| 2021-06-14 10:51:36 | <yahb> | tomsmeding: |
| 2021-06-14 10:51:40 | <tomsmeding> | % :t (&) |
| 2021-06-14 10:51:41 | <yahb> | tomsmeding: a -> (a -> b) -> b |
| 2021-06-14 10:51:48 | <tomsmeding> | Schrostfutz_: that one? |
| 2021-06-14 10:52:48 | <merijn> | Schrostfutz_: I highly recommend "just getting used to it" instead, though |
| 2021-06-14 10:52:55 | × | peterhil quits (~peterhil@dsl-hkibng32-54f849-252.dhcp.inet.fi) (Quit: Must not waste too much time here...) |
| 2021-06-14 10:53:05 | <merijn> | Or you will be unable to read >80% of haskell out there |
| 2021-06-14 10:53:31 | <Schrostfutz_> | tomsmeding: Yes, that one! |
| 2021-06-14 10:53:51 | <tomsmeding> | it's the flipped version of ($) though, not of (.) |
| 2021-06-14 10:53:57 | <Schrostfutz_> | merijn: I understand it and am used to it, but for long chains I still find it unwieldy |
| 2021-06-14 10:54:12 | <Schrostfutz_> | tomsmeding: The difference being its associativity, right? |
| 2021-06-14 10:54:21 | <tomsmeding> | :t ($) |
| 2021-06-14 10:54:23 | <lambdabot> | (a -> b) -> a -> b |
| 2021-06-14 10:54:24 | <tomsmeding> | :t (.) |
| 2021-06-14 10:54:25 | <lambdabot> | (b -> c) -> (a -> b) -> a -> c |
| 2021-06-14 10:54:27 | <merijn> | Schrostfutz_: One composes, the other does not |
| 2021-06-14 10:54:48 | <tomsmeding> | apparently some libraries define a flipped version of (.) too but it's not nearly as common |
| 2021-06-14 10:54:54 | <Schrostfutz_> | Ah |
| 2021-06-14 10:54:58 | <dminuoso> | % :t (>>>) |
| 2021-06-14 10:54:59 | <yahb> | dminuoso: forall {k} {cat :: k -> k -> *} {a :: k} {b :: k} {c :: k}. Category cat => cat a b -> cat b c -> cat a c |
All times are in UTC.