<manveru>
yeah... i don't think i understand that either :)
<manveru>
any idea why none of those haskell docs have any examples?
<infinisil>
E.g. With IO (IO is an Applicative): `putStrLn "hello" *> getLine` would first print hello, then read a line and return the line it got
<infinisil>
The result of putStrLn ( () ) gets thrown away
<infinisil>
Or `getLine *> getLine` would get 2 lines but only return the second one
<manveru>
ok, thanks
<jD91mZM2>
Is that short for `line <- getLine` `putStrLn line`?
<infinisil>
Nah
<manveru>
you don't output the line you get
<infinisil>
jD91mZM2: getLine >>= putStrLn would be short for your example
<jD91mZM2>
oh whoops
<infinisil>
If I'm not mistaken
<jD91mZM2>
Haskell is confusing :P
<manveru>
the ruby version is `puts "hello"; gets` :)
<jD91mZM2>
So *> is like "do this and if it works then do that"?
<manveru>
i don't think it cares whether it works
<infinisil>
Yeah
<infinisil>
It's "do this, throw away its result and then do that"
<jD91mZM2>
wwwwhhhyyyy
<jD91mZM2>
haskell why
<infinisil>
??
<manveru>
exactly :)
<jD91mZM2>
ok but `>>=` is "do this and if it works pass it to that"?
<infinisil>
>>= is "Do this, pass the result to that and execute that"
<infinisil>
Well "execute" in a Monad sense, it's whatever the monad defines as this
<jD91mZM2>
Ah, thanks!
<infinisil>
Oh and also
<infinisil>
Maybe is a monad too
<jD91mZM2>
Yeah, Maybe and Either. That's the only two monads I know about and almost understand
<infinisil>
Just "hi" >>= \x -> Just (x ++ "test")
<infinisil>
This should return Just "hitest"
<infinisil>
Nothing >>= \x -> Just (x ++ "test")
<infinisil>
Should return Nothing
<jD91mZM2>
Hmm, the docs describe *> as "Sequence actions, discarding the value of the first argument" and >> as "Sequentially compose two actions, discarding any value produced by the first, like sequencing operators (such as the semicolon) in imperative languages".... so what's the difference?
<infinisil>
There is none
<infinisil>
I think >> is kept for backwards compatibility
<jD91mZM2>
Ah
__monty__ has joined #nixos-chat
sir_guy_carleton has quit [Quit: WeeChat 2.0]
sir_guy_carleton has joined #nixos-chat
<infinisil>
I just learned that in this day and age, there are still people who believe that the earth is flat..
matthewbauer has joined #nixos-chat
<gchristensen>
... just now?
<gchristensen>
I'm impressed :)
<jD91mZM2>
Well you see if you look at this game you can't fly higher than X meters and I bet that's because they modelled the game after earth and don't want you to see the whole earth to realize it's flat. Wake up, sheeple! /s
Lisanna has quit [Quit: Lisanna]
<manveru>
guess they played too much minecraft
matthewbauer has quit [Read error: Connection reset by peer]
matthewbauer has joined #nixos-chat
<infinisil>
Nooo, my zpool is full..
<LnL>
no quota?
<infinisil>
Why would I want that?
<infinisil>
Ah, as a warning sign that I don't have much left?
<LnL>
because you don't want a completely fragmented pool
<infinisil>
It's not too badly fragmented actually, just full
<infinisil>
60% FRAG, 96% CAP
<LnL>
and it's nice to give you some extra wiggle room when removing stuff
<__monty__>
Zfs can't remove stuff when completely full?
<LnL>
either way --gc --max-freed is your friend
<infinisil>
My /nix makes up like 2% of the space
<infinisil>
This is good motivation to finally build a machine with lots of storage
<LnL>
wow, either you don't have much space or your store is _really_ small
<infinisil>
40GB /nix, 2TB capacity
<infinisil>
What's your /nix?
<LnL>
currently ~100G and this machine doesn't have 2TB disk space
<infinisil>
Damn, what's taking up so much space there?
<manveru>
ncdu is your friend
pie__ has joined #nixos-chat
pie__ has quit [Ping timeout: 240 seconds]
MichaelRaskin has joined #nixos-chat
<LnL>
dunno, it's usually even bigger I don't run gc unless necessary
Lisanna has joined #nixos-chat
matthewbauer has quit [Read error: Connection reset by peer]
matthewbauer has joined #nixos-chat
matthewbauer has quit [Read error: Connection reset by peer]
matthewbauer has joined #nixos-chat
<infinisil>
Hmm.. I wonder if a GC will clean up my nixops builds..
<gchristensen>
just the other day, 400GB / 45GB
matthewbauer has quit [Ping timeout: 276 seconds]
matthewbauer has joined #nixos-chat
<jD91mZM2>
Oh, not setting a cap on zfs causes fragmentation? How do you fix it?
<infinisil>
Not directly
<infinisil>
You can't unfragment zpools unfortunately, as of now at least
<LnL>
using any filesystem at 90-100% causes fragmentation
<infinisil>
Not necessarily, it depends on the types of files you use
<infinisil>
E.g. if all you do is save 1KB big files, fragmentation doesn't happen
<gchristensen>
sure, everything depends on context
<gchristensen>
ok shutting down for going across border patrol........ wish me luck :P
<infinisil>
:O
<samueldr>
I wouldn't wish lock in that situation ;)
matthewbauer has quit [Read error: Connection reset by peer]
matthewbauer has joined #nixos-chat
matthewbauer has quit [Read error: Connection reset by peer]
pie__ has joined #nixos-chat
pie__ has quit [Remote host closed the connection]
matthewbauer has joined #nixos-chat
matthewbauer has quit [Read error: Connection reset by peer]
matthewbauer has joined #nixos-chat
<andi->
depends on the direction I suppose...
matthewbauer has quit [Read error: Connection reset by peer]
matthewbauer has joined #nixos-chat
matthewbauer has quit [Read error: Connection reset by peer]
matthewbauer has joined #nixos-chat
matthewbauer has quit [Ping timeout: 245 seconds]
<infinisil>
A reasonable answer to the ultimate question of life, the universe and everything is "It depends"
matthewbauer has joined #nixos-chat
pie_ has joined #nixos-chat
<andi->
:D
jD91mZM2 has quit [Quit: WeeChat 2.0]
matthewbauer has quit [Ping timeout: 264 seconds]
infinisil has quit [Quit: Configuring ZNC, sorry for the joins/quits!]