Search Haskell Channel Logs

Monday, February 20, 2017

#haskell channel featuring sternmull, kadoban, ski, lambdabot, Tuplanolla, hpc, and 6 others.

roconnor 2017-02-20 08:45:52
set theory was supposed to be built out of predicates, but that doesn't work, so we get this weird construction that is ZF where sets are trees modulo ordering.
ski 2017-02-20 08:46:53
hello roconnor
roconnor 2017-02-20 08:47:20
Perhaps indexed sets being unordered isn't that strange, especially when the index becomes uncountable.
ski 2017-02-20 08:48:48
indexed sets = families, yes
roconnor 2017-02-20 08:49:50
sure that too.
Benzi-Junior 2017-02-20 08:49:51
does anyone here know where the vector implementations for tuples are defined ?
roconnor 2017-02-20 08:50:10
though the notion of sub-finite doesn't really exist in ZF.
roconnor 2017-02-20 08:51:04
It exists, but it is identical to finite, so it doesn't get any attention
ski 2017-02-20 08:51:23
like overt
roconnor 2017-02-20 08:51:38
yes. except I understand subfinite, but not overtness.
sternmull 2017-02-20 08:54:07
it seams stack does not use source files that i add in the src/ subirectory that was created by it. Where do i have to add them?
ski 2017-02-20 08:54:18
what is a good name for glbs of images of endofunctions on naturals ? or glbs of subsets of naturals, if you want more general ?
ski 2017-02-20 08:54:42
for the former, you can only compute approximate upper bounds (except if you reach zero)
kadoban 2017-02-20 08:56:21
sternmull: In the .cabal file , you have to specify exposed modules and "other modules", whatever the real names for them are. They should be in the file already and you just add to the list, as I recall.
sternmull 2017-02-20 08:57:21
kadoban: Can i have multiple files that belong to the same module?
kadoban 2017-02-20 08:58:17
sternmull: No. Each file is one module
sternmull 2017-02-20 08:59:06
kadoban: Oh ok.
sgript 2017-02-20 09:09:29
If I do say sqrt(25) in Haskell I get 5.0, any easy way to get 5?
sgript 2017-02-20 09:11:21
Would round $ sqrt $ fromIntegral 25 suffice?
Tuplanolla 2017-02-20 09:13:50
Does it matter if the result is a bit wrong sometimes, sgript?
sgript 2017-02-20 09:14:12
nope, but if there's a way to fix that, i would like to know anyway :d
Tuplanolla 2017-02-20 09:14:28
Number theory packages should provide integer square roots.
kadoban 2017-02-20 09:14:32
sgript: For reasonably sized inputs that should work fine, as long as you don't care much that it's off for a bit for non-squares.
kadoban 2017-02-20 09:14:52
Yeah, you can do integer square roots directly, but it doesn't seem to be in base.
Nik05 2017-02-20 09:15:18
w 4
Nik05 2017-02-20 09:15:24
im sorry
roconnor 2017-02-20 09:15:41
GMP supports integer square roots. It'd be nice to have that in base.
Nik05 2017-02-20 09:15:54
but sgript depends what you want for an answer when the argument is not a square
Tuplanolla 2017-02-20 09:15:57
Much more number theory ought to be in `base`.
Tuplanolla 2017-02-20 09:16:38
At least I often reach for logarithms, roots and factorization.
sgript 2017-02-20 09:17:06
oh the arg is always square
sgript 2017-02-20 09:17:39
answer *
sgript 2017-02-20 09:18:01
I'm just doing this for trigonometrystuff
sgript 2017-02-20 09:19:33
so is there no way to do it without packages?
kadoban 2017-02-20 09:19:55
Well, your way will work fine for reasonable inputs.
kadoban 2017-02-20 09:20:48
as-in probably anything double can represent exactly, and maybe a bit more.
sgript 2017-02-20 09:20:54
I noticed, it is a bit off actually
Nik05 2017-02-20 09:21:01
So you already know that they are squares, sgript. What do you want to do with the return value?
kadoban 2017-02-20 09:21:18
sgript: Really? For what inputs?
ski 2017-02-20 09:22:02
Tuplanolla : discrete logarithms ?
Tuplanolla 2017-02-20 09:22:47
Rounding up or down, ski.
kadoban 2017-02-20 09:24:56
sgript: Anyway, if it's not quite right and if you can't use a library, you can implement it using binary search that'll likely perform acceptably.
kadoban 2017-02-20 09:25:11
But it seems to work fine for me for reasonable inputs I tried.
kadoban 2017-02-20 09:25:35
> round . sqrt . fromIntegral $ (999999999999999^2)
lambdabot 2017-02-20 09:25:43
mueval-core: Time limit exceeded
Tuplanolla 2017-02-20 09:25:49
> floor (64 ** (1 / 3) :: Double)
lambdabot 2017-02-20 09:25:53
3
Tuplanolla 2017-02-20 09:25:56
> 3 ^ 3 :: Int
lambdabot 2017-02-20 09:26:00
27
kadoban 2017-02-20 09:26:06
> round . sqrt . fromIntegral $ (999999999999999^2)
lambdabot 2017-02-20 09:26:10
999999999999999
kadoban 2017-02-20 09:26:18
Heh, the first one was just lambdabot being funny I think.
hpc 2017-02-20 09:26:32
> floor (0/0)
lambdabot 2017-02-20 09:26:35
-269653970229347386159395778618353710042696546841345985910145121736599013708...
stepcut 2017-02-20 09:28:09
Is there a way to pass extra cpp-options on the commandline with cabal? Specifically, I want to set, -DEMBEDDED_FILEPATH="/path/to/file"
ski 2017-02-20 09:36:42
Tuplanolla : ok
dolio 2017-02-20 09:37:08
stepcut: Is it CPP as run by GHC? Wouldn't it be a GHC option, then?
stepcut 2017-02-20 09:38:52
dolio: We currently have this set in .cabal and it works `cpp-options: -DEMBEDDED_FILEPATH="/path/tofile"`, but the problem is that the path is hardcoded, but to build on Nix, we need to specify the path since it changes
dolio 2017-02-20 09:42:49
Oh, I see. I misunderstood what you were asking.