Search Haskell Channel Logs

Friday, January 27, 2017

#haskell channel featuring lambdabot, ph88, merijn, kuribas, dramforever, maerwald,

maerwald 2017-01-26 23:52:09
merijn: we talked about formal methods yesterday. Is there something like PROMELA, but functional-ish?
merijn 2017-01-26 23:52:31
I have no clue what PROMELA is?
maerwald 2017-01-26 23:52:45
the language used to model-check with SPIN
maerwald 2017-01-26 23:52:57
concurrent, distributed systems and whatnot
merijn 2017-01-26 23:53:53
muCRL, based on Mu calculus is used for model-checking distributed/concurrent things and the basic language uses term rewriting which you can see as a very inefficient functional language
maerwald 2017-01-26 23:55:44
seems there is mCRL2 now
maerwald 2017-01-27 00:01:10
merijn: interestingly, in the report you referenced yesterday they don't think "program verification" would add a lot to the quality stack (especially compared to the cost). I wonder if that will change some day with Idris, F* etc
maerwald 2017-01-27 00:02:15
they were on C++ anyway, so the conclusion might be based on that
thatguy 2017-01-27 00:05:48
what is the best way if I have a list of integers up to n and want all integers up to n which are not in that list?
dramforever 2017-01-27 00:09:02
Like a scrolling window?
dramforever 2017-01-27 00:09:06
Uh sorry wrong window
dramforever 2017-01-27 00:09:14
Hmm, 'window'...
ph88 2017-01-27 00:13:47
why do i get this error "Could not decude (Alternative f) arising from a use of '<|>'" ?? https://paste.fedoraproject.org/537534/55155851/
dramforever 2017-01-27 00:14:29
What's a 'Rule'?
ph88 2017-01-27 00:14:40
maerwald, do you know about cake ml ?
dramforever 2017-01-27 00:14:51
ph88: What's a 'Rule'?
maerwald 2017-01-27 00:14:58
ph88: no, tell me... off to lunch btw
ph88 2017-01-27 00:15:16
dramforever, class Rule f a where get :: Decorator f => f a
ph88 2017-01-27 00:15:42
maerwald, i didn't try it, just read the website https://cakeml.org/ but since you where talking about formal verification it came to mind
dramforever 2017-01-27 00:15:45
What's a decorator then? Where did you get these typeclasses?
ph88 2017-01-27 00:16:27
dramforever, i made decorator myself with idea from glguy https://paste.fedoraproject.org/537538/51576914/
dramforever 2017-01-27 00:17:01
So 'f' is a parser type right?
ph88 2017-01-27 00:17:15
f is Parser and also Gen for generating arbitrary values
dramforever 2017-01-27 00:17:25
But it doesn't necessarily support alternatives
ph88 2017-01-27 00:17:28
basically this allows me to write the functionality for Parsing and Generating in one go
ph88 2017-01-27 00:17:57
ooooooh
dramforever 2017-01-27 00:17:58
Do you ensure that *all* decorators allow <|>?
ph88 2017-01-27 00:18:02
sorry i see it now
ph88 2017-01-27 00:18:11
i made a special function for that -____-
dramforever 2017-01-27 00:18:24
Hmm, 'c'
dramforever 2017-01-27 00:18:34
You have super concise names
ph88 2017-01-27 00:18:37
i didn't really get that from the error message i was getting
ph88 2017-01-27 00:18:47
you think i should rename some stuff ?
dramforever 2017-01-27 00:18:48
:t (<|>)
lambdabot 2017-01-27 00:18:50
Alternative f => f a -> f a -> f a
dramforever 2017-01-27 00:19:07
ph88: I mean, you literally said 'e stands for element'
dramforever 2017-01-27 00:19:17
just... call that 'element'?
ph88 2017-01-27 00:19:24
yeah the problem is that with Arbitrary i didn't know how to implement <|>
danza 2017-01-27 00:19:27
quick question, hopefully: can anybody point me to some learning material about how `build-depends` works in Cabal? I am trying to reduce redundant dependency declarations in my Cabal files
danza 2017-01-27 00:20:48
i have the cabal user guide in front of me but it does not seem to go very deep about the topic
dramforever 2017-01-27 00:21:02
ph88: This sucks, but you can probably just get an arbitrary Bool and choose between the two
ph88 2017-01-27 00:21:02
dramforever, oneof from this page https://hackage.haskell.org/package/QuickCheck-2.9.2/docs/Test-QuickCheck.html is what i used instead of <|> so this requires me to use a list
dramforever 2017-01-27 00:21:36
You probably should wrap Gen
ph88 2017-01-27 00:21:47
i mean now i have to input things like oneof [a,b] for Arbitrary and then for parser i get mplus [a,b] instead of a <|> b
dramforever 2017-01-27 00:21:57
:t msum
lambdabot 2017-01-27 00:22:00
(MonadPlus m, Foldable t) => t (m a) -> m a
dramforever 2017-01-27 00:22:15
:t (\x y -> msum [x, y])
lambdabot 2017-01-27 00:22:16
MonadPlus m => m a -> m a -> m a
ph88 2017-01-27 00:22:22
eh sorry not mplus i mean asum
ph88 2017-01-27 00:22:26
:t asum
dramforever 2017-01-27 00:22:27
:t asum
lambdabot 2017-01-27 00:22:29
(Alternative f, Foldable t) => t (f a) -> f a
lambdabot 2017-01-27 00:22:30
(Alternative f, Foldable t) => t (f a) -> f a
ph88 2017-01-27 00:22:37
c = Data.Foldable.asum <-- taken from my source code
ph88 2017-01-27 00:22:58
dramforever, what do you mean with wrap Gen ?
dramforever 2017-01-27 00:23:23
Then you can write instance Alternative WrapGen without introducing an orphan instance
dramforever 2017-01-27 00:23:50
An 'orphan' instance is basically 'instance A B' where neither A nor B is in your module
ph88 2017-01-27 00:23:59
dramforever, here you see the implementation of both https://paste.fedoraproject.org/537556/51622114/ it works pretty well so far
dramforever 2017-01-27 00:24:08
It's bad because you might get horrible collisions
dramforever 2017-01-27 00:24:28
I see
ph88 2017-01-27 00:24:34
what i have now is bad ?
dramforever 2017-01-27 00:24:38
Nothing
ph88 2017-01-27 00:24:50
???
zipper 2017-01-27 00:24:52
When I'm processing a lazy stream what assurance do I have that what is processed is being garbage collected?
dramforever 2017-01-27 00:24:56
Uhh sorry I think I've gone too far
zipper 2017-01-27 00:25:00
hmmmm maybe I should code it firsy
zipper 2017-01-27 00:25:03
*first
ph88 2017-01-27 00:25:07
ok np ^^
ph88 2017-01-27 00:25:10
thanks for help
dramforever 2017-01-27 00:25:24
ph88: c [Exp <$> emin, Exp <$> eplus]
dramforever 2017-01-27 00:25:36
If you want 'c', how's that?
Profpatsch 2017-01-27 00:25:37
merijn: I've now arrived at this http://lpaste.net/351697
dramforever 2017-01-27 00:25:55
Better yet, Exp <$> c [emin, eplus]
ph88 2017-01-27 00:25:59
dramforever, yes i already fixed it :P
dramforever 2017-01-27 00:26:05
:P
ph88 2017-01-27 00:26:10
oh nice one like that
Profpatsch 2017-01-27 00:26:10
Took me a while to get the Maybe's right in withDom
dramforever 2017-01-27 00:26:42
Hmm
ph88 2017-01-27 00:27:12
dramforever, the thing was that from the error message from ghc it didn't ring a bell that i already implemented a function for this you see
dramforever 2017-01-27 00:27:43
Yeah, I see that after I read the 'Decorator' thing more throughly
ph88 2017-01-27 00:29:32
oh he left :/
kuribas 2017-01-27 00:42:02
Will haskell have dependend types someday?
Profpatsch 2017-01-27 00:42:27
merijn: Hm, when I have a function from the original DOM api that has a callback like foo :: (a -> IO b) -> IO b
Profpatsch 2017-01-27 00:42:55
How would I lift that to fooD :: (a -> Dom b) -> Dom b
Profpatsch 2017-01-27 00:43:13
liftIO of course only gives me (a -> IO b) -> Dom b
Profpatsch 2017-01-27 00:44:04
My idea would be to manually grab the reader Env and put it back together in the callback
merijn 2017-01-27 00:44:43
Profpatsch: You can't really do that, unless you use something like MonadBaseControl, or whatever it's called