maerwald 2017-01-27 01:45:35
meh, then my log replay is broken
ertes 2017-01-27 01:45:49
[17:04:51] maerwald: i have barely touched memory safety with haskell… all i can say right now is that it's difficult, even if limit yourself to Storable operations… i believe that GHC-side support is necessary to fix this
ertes 2017-01-27 01:45:50
[17:05:08] maerwald: alternatively make sure that GHC never gets to see the data by FFIing into C
ertes 2017-01-27 01:45:56
[17:07:20] but even then, say in a crypto setting, GHC gets a hold of plaintext first, before it passes it on to C, so there is potential for data leakage, too
ertes 2017-01-27 01:45:56
LazyUncleBob 2017-01-27 01:46:14
The piece of code I linked effectively freezes my system, since it never stops running.
maerwald 2017-01-27 01:46:19
ertes: thanks
LazyUncleBob 2017-01-27 01:46:21
Which sucks.
maerwald 2017-01-27 01:46:37
well, I'd say we should call this "memory security" in fact
ertes 2017-01-27 01:47:03
tfc: in that case don't use ping… send a UDP packet
tfc 2017-01-27 01:47:26
ertes yeah looks like that will do. thank you for the input.
asthasr_ 2017-01-27 01:47:30
it works fine on mine, LazyUncleBob
asthasr_ 2017-01-27 01:47:35
what number are you using for input
LazyUncleBob 2017-01-27 01:47:40
1.
liste 2017-01-27 01:47:56
LazyUncleBob: works for me at least, what are you testing it with? https://ideone.com/LjI5jv
asthasr_ 2017-01-27 01:47:58
yep, it works fine
LazyUncleBob 2017-01-27 01:48:12
Okay.. I'm using ghci, really.
LazyUncleBob 2017-01-27 01:48:25
With the "prelude>" thingy.
asthasr_ 2017-01-27 01:48:50
a minor style point, LazyUncleBob -- instead of calling your type variable 'bigInt,' it's idiomatic to say "a." so your signature could look like (Integral a) => a -> a
asthasr_ 2017-01-27 01:49:12
then, of course, use something different for your argument, like n.
LazyUncleBob 2017-01-27 01:49:17
Right, okay, thank you.
asthasr_ 2017-01-27 01:49:28
can you copy and paste your GHCI session?
ertes 2017-01-27 01:49:30
LazyUncleBob: did you load a source file or type the function by hand?
LazyUncleBob 2017-01-27 01:49:41
I mean, I've re-ran it now
LazyUncleBob 2017-01-27 01:49:44
and it does infact work.
LazyUncleBob 2017-01-27 01:49:55
Previously this literally froze my system.
Profpatsch 2017-01-27 01:50:16
merijn: I've solved my callback problem with this function:
LazyUncleBob 2017-01-27 01:50:20
I'm flabbergasted.
Profpatsch 2017-01-27 01:50:35
withDomEnv :: DomEnv -> Dom a -> IO a
Profpatsch 2017-01-27 01:50:37
withDomEnv e d = (runReaderT $ runDom d) e
asthasr_ 2017-01-27 01:51:05
LazyUncleBob: We are magic
asthasr_ 2017-01-27 01:51:23
Most likely, you had a typo when you entered it before. If your terminal condition is not right, then recursion will fail to end
ertes 2017-01-27 01:51:39
@bot feature request: copy pastes from JS-only pastebins to lpaste.net
lambdabot 2017-01-27 01:51:39
:)
asthasr_ 2017-01-27 01:51:57
for example, leaving out the "0 = 1" case in a recursive definition of a factorial
asthasr_ 2017-01-27 01:52:25
and yeah, hastebin (although it has a nice interface) is kind of buggy and unreliable, so I'd recommend using lpaste.net
merijn 2017-01-27 01:53:20
Nice interface == usually doesn't load for me? :p
ertes 2017-01-27 01:54:20
even a nice-interface pastebin can work without JS
ertes 2017-01-27 01:54:27
it's just less nice without it
hpc 2017-01-27 01:54:48
lpaste has a nicer interface
hpc 2017-01-27 01:54:50
imo
hpc 2017-01-27 01:54:58
nicest of any pastebin i have used
ertes 2017-01-27 01:55:38
lpaste feature request: make hlint optional AND DISABLED BY DEFAULT
maerwald 2017-01-27 01:55:44
ertes++
maerwald 2017-01-27 01:56:45
but guess what... chrisdone has disabled the issue tracker, no surprise
ertes 2017-01-27 01:57:35
really? that's odd
maerwald 2017-01-27 01:58:07
I once opened a similar bug complaining about hlint stuff that was outright wrong
thatguy 2017-01-27 02:00:10
I have a list of some integers up to n L, and I want to have all integers up to n excluding the ones in L (so the complement in some sense)
thatguy 2017-01-27 02:00:12
how do I do that
Ferdirand 2017-01-27 02:00:57
> [1..10] \\ [2,7]
ertes 2017-01-27 02:00:58
thatguy: is the list sorted?
lambdabot 2017-01-27 02:00:59
[1,3,4,5,6,8,9,10]
thatguy 2017-01-27 02:01:08
ertes, yes
thatguy 2017-01-27 02:01:16
Ferdirand, isn't that very ineffective
thatguy 2017-01-27 02:01:20
if the list is sorted
thatguy 2017-01-27 02:01:23
which I forgot to say
Ferdirand 2017-01-27 02:01:26
yes, but you didn't say it was
ertes 2017-01-27 02:01:35
thatguy: wait, do you need complement or difference?
ertes 2017-01-27 02:01:39
(\\) is difference
thatguy 2017-01-27 02:02:13
I need exactly the result Ferdirand got but I hoped there is a more effective way
thatguy 2017-01-27 02:02:18
Ferdirand, yes sorry I forgot
merijn 2017-01-27 02:02:26
argh...
ertes 2017-01-27 02:02:32
thatguy: then use Set
merijn 2017-01-27 02:02:43
It's "I minorly changed my code and now Conduit is all upset at my types" o clock :\
hpc 2017-01-27 02:02:55
merijn: try turning it off and on again
ertes 2017-01-27 02:03:06
merijn: switch to pipes already ;)
merijn 2017-01-27 02:03:23
ertes: That'd mean I'd have to port all libraries
hpc 2017-01-27 02:03:57
thatguy: you can write it in O(n) time if you do it yourself
ertes 2017-01-27 02:04:12
yeah, that's exactly what you should do, because then i could get closer to getting rid of conduit, too ;)
hpc 2017-01-27 02:04:38
thatguy: traverse both the complete list and the list you're subtracting
merijn 2017-01-27 02:04:42
ertes: tbh, pipes give me the same shit
merijn 2017-01-27 02:05:05
ertes: Where I end up having to chase type errors for hours when I change something small
hpc 2017-01-27 02:05:11
thatguy: and only step further into one of the lists if its head element is less than the other's head element
thatguy 2017-01-27 02:05:36
hpc, yeah thanks
merijn 2017-01-27 02:05:59
Like...wtf?
merijn 2017-01-27 02:06:01
Couldn't match type 'ConduitM Event o0 SqlM (Maybe ())'
merijn 2017-01-27 02:06:01
with 'forall o. ConduitM Event o SqlM (Maybe a0)'
merijn 2017-01-27 02:06:01
Expected type: Consumer Event SqlM (Maybe a0)
merijn 2017-01-27 02:06:01
Actual type: ConduitM Event o0 SqlM (Maybe ())
merijn 2017-01-27 02:06:09
How do those not match?!?
merijn 2017-01-27 02:06:13
WTF is wrong with you?!
hpc 2017-01-27 02:06:25
merijn: it's not a higher-ranked type, is it?
merijn 2017-01-27 02:06:42
Consumer is rank 2
merijn 2017-01-27 02:07:00
hpc: I've tried adding an explicit free type variable too, but that doesn't work either
hpc 2017-01-27 02:07:07
hmm
ertes 2017-01-27 02:07:17
merijn: i'm assuming that o0 comes from the context, whereas you need to supply a polymorphic function?
merijn 2017-01-27 02:07:38
ertes: The point is that I'm never emitting any output
merijn 2017-01-27 02:07:50
I want my thing to be a Sink, but I can't figure out how to make that typecheck
ertes 2017-01-27 02:09:02
well, pipes uses Void there, which avoids errors like this, especially with MR
mniip 2017-01-27 02:09:17
merijn, it looks like o0 is skolem
mniip 2017-01-27 02:09:34
and you expect it to be universally quantified
merijn 2017-01-27 02:09:41
ertes: No, because when I put in Void it doesn't work either!
mniip 2017-01-27 02:09:45
however I can't tell for sure from the types involved
merijn 2017-01-27 02:10:59
ertes: Then I just "can't match 'ConduitM Event Void SqlM (Maybe ())' instead of the free type variable
ertes 2017-01-27 02:11:28
ah, conduit does that, too… nevermind
ertes 2017-01-27 02:12:55
merijn: so you're using a function that expects a Consumer, but you (want to) have a Sink?
merijn 2017-01-27 02:14:09
I have a function "skipMany :: MonadThrow m => Consumer Event m (Maybe a) -> Consumer Event m ()" that I'm passing something too but it can't seem to live with that...
ertes 2017-01-27 02:14:26
merijn: in that case you need to use toConsumer
ertes 2017-01-27 02:14:41
if you have a Sink
merijn 2017-01-27 02:14:58
I don't have a Sink, I think?
merijn 2017-01-27 02:15:03
I'm not sure what I have
jophish 2017-01-27 02:15:06
Is there a table somewhere of all the GHC language extensions with the version they were introduced?
ertes 2017-01-27 02:15:07
you want to have one
jophish 2017-01-27 02:15:14
yes
ertes 2017-01-27 02:15:29
merijn: so have one and use toConsumer =)
ertes 2017-01-27 02:15:49
jophish: the GHC manual includes version numbers
merijn 2017-01-27 02:19:24
ertes: Nope...stuffed a toConsumer in there, still no cigar
merijn 2017-01-27 02:20:43
I can't easily paste this code either as it depends on an unreleased version of xml-conduit >.>
chpatrick 2017-01-27 02:23:06
what's the easiest way to make a derivation that's just a collection of packages?
merijn 2017-01-27 02:23:07
ertes: Ok, so if I replace the offending bit with a hole, I get a hole for "Consumer Event SqlM (Maybe a)", and what I need to fit in there is 'Sink Event SqlM (Maybe ())', which seems like it *should* be trivial
chpatrick 2017-01-27 02:23:16
oops meant #nix :)
merijn 2017-01-27 02:23:50
Logically you'd expect 'toConsumer' to work, but if I replace the hole with 'toConsumer _' I get a type error too
jophish 2017-01-27 02:24:46
ah, didn't spot it in there. Thanks ertes!
merijn 2017-01-27 02:24:59
I'm just at a complete loss WTF is going on here...
kuribas 2017-01-27 02:26:30
is there a kind for constrained type variables?
kuribas 2017-01-27 02:26:58
for example Ord a => a -> *
merijn 2017-01-27 02:27:19
No, only a kind for constraints themselves
merijn 2017-01-27 02:27:28
ertes, mniip: Any idea/suggestions?
mniip 2017-01-27 02:28:17
sorry I have no idea about the context
merijn 2017-01-27 02:30:11
mniip: https://gist.github.com/merijn/90aaee65aa09079314f8634d9412351d on line 207 it claims 'item' doesn't typecheck
merijn 2017-01-27 02:30:33
But I have no clue why the hell it wouldn't...
thatguy 2017-01-27 02:30:39
this code takes two lists, one of which is a subset of the other and both are sorted and makes the difference: http://lpaste.net/351699 can anyone tell me if I programmed it good or if there are things to do better?
thatguy 2017-01-27 02:30:49
hpc, it is the algorithm you described to me
mniip 2017-01-27 02:31:25
merijn, oh my that's huge
merijn 2017-01-27 02:32:10
mniip: Yeah, but I have no idea how to minimize this issue
merijn 2017-01-27 02:32:47
It was all working before I decided to "simplify" things and I can't figure out which change broke it
tabaqui1 2017-01-27 02:33:08
does anybody know - is Data.Map persistent object?
tabaqui1 2017-01-27 02:33:16
I mean, if insert new value in it
tabaqui1 2017-01-27 02:33:26
it takes new O(n) memory in heap?
merijn 2017-01-27 02:33:37
tabaqui1: No, because it reuses parts of the old map
tabaqui1 2017-01-27 02:34:03
merijn: Is it true for any pure object in haskell?
tabaqui1 2017-01-27 02:34:39
if I fondly create my own tree, it will be perisitent?
merijn 2017-01-27 02:34:54
Define "persistent"
dramforever 2017-01-27 02:35:10
shared?
dramforever 2017-01-27 02:35:12
Of course yes
tdammers 2017-01-27 02:35:37
if you create your own tree, all the parent-child relationships will be implemented by reference, so if you add things to an existing tree, the new tree will share most of the data with the old one
dramforever 2017-01-27 02:35:38
tabaqui: You want to have the two trees to share a 'leg' right?
tabaqui1 2017-01-27 02:36:09
merijn: I'll try, but sorry for my english
dramforever 2017-01-27 02:36:32
tabaqui: Do you do competitive programming?
tabaqui1 2017-01-27 02:36:34
tdammers and dramforever: yeas, right
tabaqui1 2017-01-27 02:36:38
wait a sec
dramforever 2017-01-27 02:36:56
There's no need to copy, *because* we can't change them
dramforever 2017-01-27 02:37:14
makes sense to you?
merijn 2017-01-27 02:39:05
*head desk*
merijn 2017-01-27 02:39:13
Jesus Christ, why is this so impossible
tabaqui1 2017-01-27 02:39:14
merijn: persistent means that in any time, I can recover previous versions of object and any datum is keeped in one copy
dramforever 2017-01-27 02:39:52
Ah, that's classic
tabaqui1 2017-01-27 02:40:07
dramforever: yeah, but if I have "a = [1,2,3], b = 4:a, c = 5:a"
dramforever 2017-01-27 02:40:13
tabaqui: Yes, if you make your own trees and store them it will work
tabaqui1 2017-01-27 02:40:17
I want to allocate only 5 integers in memory
dramforever 2017-01-27 02:40:26
tabaqui: Yes!
dramforever 2017-01-27 02:40:39
It would be like, uh I can't draw in IRC, wait a sec
tabaqui1 2017-01-27 02:40:56
I know how to write peristent deck
dramforever 2017-01-27 02:41:00
I'll do a text version
cfoch 2017-01-27 02:41:24
Hi, carter
tabaqui1 2017-01-27 02:41:25
but I don't know how haskell could do it for arbitrary data
cfoch 2017-01-27 02:41:31
are you still using NixOS?
dramforever 2017-01-27 02:41:40
tabaqui: by not copying
carter 2017-01-27 02:41:58
Who dat? I was never using nix
cfoch 2017-01-27 02:43:08
I don't remember who was using it
cfoch 2017-01-27 02:43:23
But someone here was using NixOS
dramforever 2017-01-27 02:43:36
tabaqui: http://imgur.com/OwEDZXJ
cfoch 2017-01-27 02:43:37
2 years ago I think
tabaqui1 2017-01-27 02:43:58
dramforever: yeah, persistent stack
buglebud_ 2017-01-27 02:44:18
i'm trying to configure my hakyll site by saying if a certain word is in the metadata then add a script tag, but i'm getting a type error saying that type Metadata is not a Map, but is it in the documentation http://lpaste.net/351700.... documentation: https://jaspervdj.be/hakyll/reference/Hakyll-Core-Metadata.html
buglebud_ 2017-01-27 02:44:48
but it is*
tabaqui1 2017-01-27 02:44:49
it's not so easy with persistent fifo, and I'm not sure that possible with any algebraic structres
dramforever 2017-01-27 02:44:50
tabaqui: Hmm... Does 'Constructors really just take pointers' make sense to you?