mniip 2017-02-08 16:46:24
is SZ' a monomorphic type?
mniip 2017-02-08 16:46:35
'SZ *
erisco 2017-02-08 16:46:45
SZ :: Sing 'Z
erisco 2017-02-08 16:47:45
Sing is a data family. Why can I not use this constructor though... what a bummer
halogenandtoast 2017-02-08 16:48:08
Is there any reason to use let over where. I've found I currently prefer where over let (usually because I then don't require a do block).
mniip 2017-02-08 16:48:15
erisco, what happens if you say
erisco 2017-02-08 16:48:26
halogenandtoast, let is an expression, where is not
mniip 2017-02-08 16:48:28
type (SZ' :: Sing 'Z) = SZ
geekosaur 2017-02-08 16:48:30
if you need to work in expression syntax and not declaration syntax
mniip 2017-02-08 16:48:31
and then use that
geekosaur 2017-02-08 16:48:52
also let does not require do
geekosaur 2017-02-08 16:48:58
> let a = 5 in a
lambdabot 2017-02-08 16:49:00
5
kadoban 2017-02-08 16:49:02
halogenandtoast: let * in * doesn't require a do block
halogenandtoast 2017-02-08 16:49:07
yeah I like that even less
kadoban 2017-02-08 16:49:08
Oh ... already covered.
erisco 2017-02-08 16:49:37
mniip, Malformed head of type or class declaration: (SZ' :: Sing Z)
mniip 2017-02-08 16:49:56
drop the parens then :s
mniip 2017-02-08 16:50:04
the syntax is wonky
erisco 2017-02-08 16:50:11
parse error on input `::'
lpaste_ 2017-02-08 16:51:11
halogenandtoast pasted "WhereVsLet.hs" at http://lpaste.net/4701458879387533312
erisco 2017-02-08 16:51:19
if monomorphic is a requirement then I am going to have problems anyways because I also need successor
mniip 2017-02-08 16:51:24
hrm
mniip 2017-02-08 16:51:29
can you lpaste it so I could tinker
halogenandtoast 2017-02-08 16:51:31
a before/after that shows my preference ^^ does it make sense to use where there?
halogenandtoast 2017-02-08 16:52:10
also is that the "proper" way to indent a long constructor?
erisco 2017-02-08 16:53:06
mniip, http://lpaste.net/352257
Welkin 2017-02-08 16:53:49
halogenandtoast: each parameter on its own line
Welkin 2017-02-08 16:53:54
that is how I do it
Welkin 2017-02-08 16:54:12
data LongConstructor = LongConstructor a b c d e f g
Welkin 2017-02-08 16:54:17
LongConstructor
Welkin 2017-02-08 16:54:18
a
Welkin 2017-02-08 16:54:18
b
Welkin 2017-02-08 16:54:20
...
mniip 2017-02-08 16:54:41
erisco, SingI?
erisco 2017-02-08 16:55:14
hrm, I could run into illegal constraint errors with that couldn't I
halogenandtoast 2017-02-08 16:55:30
erisco: well SingI isn't defined in your paste
mniip 2017-02-08 16:55:31
no I mean I can't ghci your example
halogenandtoast 2017-02-08 16:55:33
so it's an error for us
erisco 2017-02-08 16:55:34
well you can kill that line
erisco 2017-02-08 16:55:47
yes I get that :P kill the line
halogenandtoast 2017-02-08 16:56:23
It's dead, where do I dump the body?
erisco 2017-02-08 16:56:49
/dev/null
mniip 2017-02-08 16:57:24
oh
mniip 2017-02-08 16:57:29
so it's a GADT instance
mniip 2017-02-08 17:01:15
erisco, https://ghc.haskell.org/trac/ghc/wiki/GhcKinds#Promotingdatafamilies
mniip 2017-02-08 17:01:47
though,
mniip 2017-02-08 17:04:49
oh boy
mniip 2017-02-08 17:05:02
erisco, you can totally just move the instance into a different module
mniip 2017-02-08 17:05:05
though,
mniip 2017-02-08 17:05:07
it is a bug
mniip 2017-02-08 17:05:12
probably
mniip 2017-02-08 17:06:55
(I realized this by typing "type SZ' = SZ" in ghci)
eacameron 2017-02-08 17:13:03
What's the most popular tool for generating random numbers and shuffling lists?
mniip 2017-02-08 17:13:19
/dev/urandom, probably
kadoban 2017-02-08 17:13:31
Tool or haskell library?
eacameron 2017-02-08 17:13:50
I mean Haskell library
ertes 2017-02-08 17:14:23
could someone tell me how casMutVar# works? how does it facilitate comparison? and which argument is actually used for it?
kadoban 2017-02-08 17:14:40
System.Random from the 'random' package? I'm not 100% sure it has shuffle though.
ertes 2017-02-08 17:15:24
eacameron: mwc-random can do both
eacameron 2017-02-08 17:15:48
kadoban: It doesn't have shuffle but random-shuffle package builds on it to provide that.
ertes 2017-02-08 17:15:56
eacameron: https://hackage.haskell.org/package/mwc-random-0.13.5.0/docs/System-Random-MWC-Distributions.html#g:5
kadoban 2017-02-08 17:16:18
Ah nice, I didn't see shuffle in mwc-random
ertes 2017-02-08 17:17:14
mwc-random is also probably the fastest option on hackage
eacameron 2017-02-08 17:17:49
ertes: Ah cool. Looks like it's pretty solid.
eacameron 2017-02-08 17:17:56
ertes: Thanks very much BTW
erisco 2017-02-08 17:18:04
mniip, hm, well I'll have to rethink things a bit then
l_zzie 2017-02-08 17:30:41
what package do I use for type-level ints in haskell in 2017?
l_zzie 2017-02-08 17:30:42
lol
ertes 2017-02-08 17:31:26
l_zzie: base =)
ertes 2017-02-08 17:31:49
GHC.TypeLits more specifically… not the most versatile solution, but good enough in many cases
l_zzie 2017-02-08 17:32:12
Ints, not Nats, sadly
jle` 2017-02-08 17:33:50
ertes: can you clarify your question you pinged me?
ertes 2017-02-08 17:33:52
what do you need? just reification and reflection? or do you need computation as well?
ertes 2017-02-08 17:34:15
jle`: hmm? did i ping you?
l_zzie 2017-02-08 17:34:19
just reification and reflection I think
jle` 2017-02-08 17:34:39
oh sorry, erisco
ertes 2017-02-08 17:34:46
l_zzie: then the reflection library can lift and lower arbitrary types
todaystomorrow 2017-02-08 17:36:16
I want to start programming in 3 dimensional games with haskell. I'm looking at ways to start, lambdacube engine looks good, but openGL appears to look good as well, I would love it if someone would tutor me on how to do a hello world.
ertes 2017-02-08 17:37:01
todaystomorrow: how deeply do you want to get into it, considering that there aren't any full haskell game engines yet?
mniip 2017-02-08 17:37:03
are we talking 3 spatial dimensions
l_zzie 2017-02-08 17:37:36
ertes ty, i'll look at that
todaystomorrow 2017-02-08 17:38:21
ertes I would love to develop that, I'm studying a game called frag
todaystomorrow 2017-02-08 17:39:54
so ertes, this is just going to be a bit messy isn't it? There's many different tounges for 3d game programming with haskell and I... could be the one to unify it?
ertes 2017-02-08 17:40:01
todaystomorrow: 3D from a geometrical standpoint requires some basic linear algebra knowledge, most notably matrices… if someone uses the word "transformation matrix", do you know what is meant?
mniip 2017-02-08 17:41:35
affine transforms, quaternion positions, rotation matrices
todaystomorrow 2017-02-08 17:42:22
ertes no I don't
ertes 2017-02-08 17:42:40
todaystomorrow: then your first step is to learn basic linear algebra =)
todaystomorrow 2017-02-08 17:42:45
ertes I have some projects that wouldn't require me to understand that. I want to make a 3d rubix cube
todaystomorrow 2017-02-08 17:43:31
ertes, so you would recommend I first learn linear algebra? shouldn't I start just programming to get myself warmed up for it?
ertes 2017-02-08 17:43:34
todaystomorrow: even just perspective projection requires it, and it's not too much learning overhead either
ertes 2017-02-08 17:44:24
todaystomorrow: you can (and probably should) do both in tandem, but i can't point you to any rendering libraries that come will batteries included
ertes 2017-02-08 17:44:33
todaystomorrow: luminance may be closest though
ertes 2017-02-08 17:45:02
it still wants you to write your own shaders though, so it's still fairly low-level