« first day (488 days earlier)      last day (1475 days later) » 

01:16
ok... so how to make sure a computation is only done once (i.e. what's haskell's equivalent of assignment)
@ASCII-only how to make sure a computation is only done once: depends a lot on what you really want
what's haskell's equivalent of assignment: use let or where for local bindings, I think I don't need to explain for globals
 
1 hour later…
02:53
@Bubbler do let and where ensure only computing once for foo = expression though
I believe so if foo's type is not a function
though its values are lost when the enclosing function returns, just like many other languages
so as long as the expression results in something that's not a function?
03:26
ok. anyone know why this error is happening?
https://tio.run/##7Vzrd9vGcv/Ov2IvomsC4UOU7N62iqlU1sNRq1dFOTc9oiqDwJJEDQI0AMpUYv/t6fxmFi@KlJ30nJ5@qHwCErszs7Mzs/PYXWbkptPfPTd7/bqpI7@5f/zght1p2vit8506O7h4@@7g7bE6CfUyGIX6NEozN/J02lY3j3M9eIzi6HFWaf050J@u3CzTSZSq7zpfGo1Z7C9CrUBW2fE8C2bBr7qtkkV0lcSTtlpEwfixrY70aDGxu12nrU59HWXmazRfZERWQK@JUFud/TSgr3gcaRpnFkRBOgO4oz5NdaIbjWA2j5NMHcZRlsRh9zyOXL87yNxM0zMJvCyHOHIzt3s4dZNaw0kc@i5Ntt64iLwsiKNa41mQ1mmdu48jvdIyN4Mqm763lRsS0201DiL/70E2PdJjdxFm1JDEM9BzcvTBY5rpWff0cqXh2o38eJY33uhl1r1KgigbFxP/uHDDYBxoX1gY6Ey5qRps6Cau0H3eaDQy0qmRuepD0NIC6StquIUC7qQNX9FmQx2kDUea6Q
wait
 
5 hours later…
08:04
@ASCII-only Because you can't use when to conditionally re-assign result. The assignment isn't even part of a do-block.
Also, why are you writing anything of substance in TIO?
Seems like you're only one Windows update away from disaster
or browser crash, if you avoid windows
Oh never mind, I see what you're doing
@EsolangingFruit bc i usually don't have access to my main computer :P
08:58
@ASCII-only and I was told I was crazy for developing a 3d game in JS fiddle :P
@flawr honestly i do everything online now
e.g. this (this)
warning: js, not haskell
you're crazy :)
:P
to be fair, that site is also a platform for developing node apps
offtopic, but... i have no idea what would be a good way to implement constructors
like... it wouldn't be just <type>, because that's not a function. and if it was a function (e.g. new <type>), it would need to be able to take different numbers of arguments, based on the type (at what is essentially compile time, too)
@ASCII-only what exactly is this "node"?
@flawr node.js, server side js basically
09:09
ah I see
@ASCII-only you're talking about haskell now?
@flawr no. hence why it's offtopic
Well I was confused because you mentioned compile time
haskell isn't the only compiled language :P
@ASCII-only I refuse to believe so!
09:45
I really like the #-argument construction in mathematica
for example (#+3)^# & represents the function f(x) = (x+3)^x (the & is just a delimite of the lambda)
10:23
@flawr many languages have this
perl being the most obvious example
@flawr well. if there are haskell features you like, i could (eventually try to) implement them :P
10:57
@ASCII-only who would ever consider perl a language? :P
But apart from perl, do you know any other languages that do have this feature?
iirc... swift or something?
VSL was/is going to have it
oh also do you have opinions on sum types vs enums?
I don't know either
@flawr ?????
@flawr ?
11:00
@ASCII-only I'm not familiar with these.
@ASCII-only I'm not familiar with these.
:P
@flawr sum type = data foo = Bar | Baz
enum = like that, but they're just numbers in disguise. Enum in haskell, the alternative to sum types (well, at least those with 0-argument constructors) in other languages
 
11 hours later…
22:21
:/ what's wrong now
https://tio.run/##7Txrd9vGct/xK/YiuiYQPkTJ7m2rmEpliXLU6lVRzk2PqMogsCRRgwCNBWQqsX97Oo9dvETSTnpOTz9UPgGJ3ZnZ2XntzO4yE0/Nf/e97PXrloyD1uHw0Yt6c2X91v1OnB9dvn139HYoTiO5CieRPItV5sW@VB1x@7SUo6c4iZ8WldafQ/np2ssymcZKfNf9YlmLJMgjKZCscJJlFi7CX2VHpHl8nSazjsjjcPrUESdyks@cXs/tiLNAxpn@Gi/zDMgy6A0Q6ojzn0bwFR8nEsZZhHGoFgjuik9zmUrLChfLJM3EcRJnaRL1LpLYC3qjzMskPNPQzwzEiZd5veO5l9YaTpMo8GCy9cY89rMwiWuN56Gq07rwniay0bLUgwoHvneEFwHTHTEN4@DvYTY/kVMvjzJoSJMF0nMN@uhJZXLRO7tqNNx4cZAsTOOtXGW96zSMs2kx8Y@5F4XTUAbMwkhmwlNitKEbuMLuC8uyMtCplrkYoKC5BaUvoOEOFXDPbfgV2xxUB2jD5WZ4Q0DnLM7kDOaJU49nrkFq9JKmoZN738X
where does this IO Integer even come from
wait :| oops

« first day (488 days earlier)      last day (1475 days later) »