Search Haskell Channel Logs

Saturday, February 4, 2017

#haskell channel featuring noan, hpc, sm, Welkin, lambdabot, c_wraith,

Tuplanolla 2017-02-04 05:48:34
I see the expression `pure ()` be called `pass`, `obvious`, `skip` and `end`. Which name should I choose?
c_wraith 2017-02-04 05:48:48
skip doesn't make a lot of sense.
c_wraith 2017-02-04 05:48:55
end isn't true
Welkin 2017-02-04 05:48:57
I've never seen it called any of those
Welkin 2017-02-04 05:49:00
where do you see this?
c_wraith 2017-02-04 05:49:04
it's called pass in python
Tuplanolla 2017-02-04 05:49:08
Hoogle, Welkin.
c_wraith 2017-02-04 05:49:47
in general, none of those names have enough advantages over just using `pure ()` to be worth using.
Tuplanolla 2017-02-04 05:50:18
That may be, but it's still nice to have a name for it.
c_wraith 2017-02-04 05:50:28
They all have the giant downside of being more work to look up than the idea is worth
hpc 2017-02-04 05:50:41
^
Welkin 2017-02-04 05:50:54
I find this *very* true
hpc 2017-02-04 05:51:09
also you'd have to get downright obfuscated to get any significant typing savings on "pure ()"
Welkin 2017-02-04 05:51:10
especially when you start using too many DSLs that redfine common things for *no reason whatsoever*
hpc 2017-02-04 05:51:19
3 characters isn't worth it to gain zero abstraction
xcmw 2017-02-04 06:03:35
Is there a double <&> operator? a ? b = a <&> (<&> b)?
Tuplanolla 2017-02-04 06:04:20
It's useful to be able to mentally say "pass" instead of "pure unit".
Tuplanolla 2017-02-04 06:04:42
:t \ a b -> a <&> (<&> b)
lambdabot 2017-02-04 06:04:44
(Functor f1, Functor f) => f (f1 a) -> (a -> b) -> f (f1 b)
Welkin 2017-02-04 06:06:31
:t (<$>) . (<$>)
lambdabot 2017-02-04 06:06:34
(Functor f1, Functor f) => (a -> b) -> f (f1 a) -> f (f1 b)
Welkin 2017-02-04 06:06:48
:t (<&>) . (<&>)
lambdabot 2017-02-04 06:06:50
Functor f => f a -> (f b1 -> b) -> (a -> b1) -> b
Welkin 2017-02-04 06:07:04
:t flip ((<$>) . (<&>))
lambdabot 2017-02-04 06:07:06
(Functor f1, Functor f) => f (a -> b) -> f1 a -> f (f1 b)
Welkin 2017-02-04 06:07:09
:t flip ((<$>) . (<$>))
lambdabot 2017-02-04 06:07:11
(Functor f1, Functor f) => f (f1 a) -> (a -> b) -> f (f1 b)
Welkin 2017-02-04 06:07:14
there you go
Welkin 2017-02-04 06:07:49
@let <&&> = flip ((<$>) . (<$>))
lambdabot 2017-02-04 06:07:49
Parse failed: Parse error: <&&>
Welkin 2017-02-04 06:07:56
@let (<&&>) = flip ((<$>) . (<$>))
lambdabot 2017-02-04 06:07:59
Defined.
ongy 2017-02-04 06:09:12
:t (<&&>)
lambdabot 2017-02-04 06:09:14
(Functor f1, Functor f) => f (f1 a) -> (a -> b) -> f (f1 b)
xcmw 2017-02-04 06:10:42
Ok thanks
noan 2017-02-04 06:12:12
Sooo... put my database schema in one file, or split it over many in a db directory?
Welkin 2017-02-04 06:13:13
noan: I usually use one file
Welkin 2017-02-04 06:13:16
are you using Persistent?
noan 2017-02-04 06:13:23
I am.
Welkin 2017-02-04 06:13:27
then go with one file
Welkin 2017-02-04 06:13:31
the syntax is very compact
noan 2017-02-04 06:13:37
was thinking so because of that
noan 2017-02-04 06:13:48
otherwise I have more boilerplate than schema in each file XD
noan 2017-02-04 06:15:14
my instance ToJSON foo and such at the end of the schema are gonna be a biiit weird
Welkin 2017-02-04 06:18:11
noan: you can have those autogenerated
Welkin 2017-02-04 06:18:16
unless you need them to be custom
Welkin 2017-02-04 06:18:30
just add the keyword `json` after the type/table name
noan 2017-02-04 06:19:09
last time I tried that it blew up in my face.
noan 2017-02-04 06:19:12
lets try again
noan 2017-02-04 06:20:22
yep, it mad.
Welkin 2017-02-04 06:20:33
you might need the {-# LANGUAGE DeriveGeneric #-} pragma
Welkin 2017-02-04 06:20:39
along with `import GHC.Generics (Generic)`
noan 2017-02-04 06:21:14
both present
noan 2017-02-04 06:21:17
sec, gisting
noan 2017-02-04 06:22:23
https://gist.github.com/AlexaDeWit/7d5b535cc4f3b4eec0217af8bc26bd43
Welkin 2017-02-04 06:22:51
add another pragma FlexibleInstances
noan 2017-02-04 06:22:56
ty
noan 2017-02-04 06:23:22
all is calm
noan 2017-02-04 06:23:30
you're a good man Welin
noan 2017-02-04 06:23:41
maybe. Unless you're secretly plotting the downfall of humanity. Or something.
sm 2017-02-04 06:26:06
or not a man
noan 2017-02-04 06:27:01
oh that too.
noan 2017-02-04 06:29:33
Migration worked!"
sm 2017-02-04 06:30:04
if you've seen the recent Hidden Figures.. it often still feels like those all-male mission/computer rooms around here
Welkin 2017-02-04 06:30:36
lol
Welkin 2017-02-04 06:30:45
I just found out about that film last night
sm 2017-02-04 06:30:52
it's a pretty good film
benzrf 2017-02-04 06:34:21
dismantle patriarchy tbh
Welkin 2017-02-04 06:35:01
you mean oligarchy
benzrf 2017-02-04 06:35:07
both
Welkin 2017-02-04 06:37:11
@undo do { a; b}
lambdabot 2017-02-04 06:37:11
a >> b
sm 2017-02-04 06:37:56
male techies should watch it. I liked that scene where the women take over the IBM/fortran lab