Alxandr 2017-02-07 21:52:20
Hi. I'm trying to get the version of my application in haskell, and I read on stackoverflow that I could import Paths_ to do so
Alxandr 2017-02-07 21:52:37
I did this, and it builds, but it doesn't link
dmwit 2017-02-07 21:53:06
Did you include Paths_ in your exposed-modules or extra-modules list?
phadej 2017-02-07 21:53:07
you have to add Paths_packagename to the other-modules
phadej 2017-02-07 21:53:15
sorry, extra-
phadej 2017-02-07 21:53:17
^
dmwit 2017-02-07 21:53:54
Oops, now I'm not sure whether it's extra- or other-. Consult the documentation or use trial-and-error. =P
Alxandr 2017-02-07 21:54:31
Ah, no, that was it :)
Alxandr 2017-02-07 21:54:33
Thanks
phadej 2017-02-07 21:54:38
great
Alxandr 2017-02-07 21:55:23
Btw; what's involved in publishing a haskell package to hackage/stackage?
dmwit 2017-02-07 21:55:50
Publishing to Hackage: make a Hackage username, then `cabal sdist && cabal upload dist/*.tar.gz`.
dmwit 2017-02-07 21:56:51
For stackage, check the official information here: https://github.com/fpco/stackage/blob/master/MAINTAINERS.md#adding-a-package
Alxandr 2017-02-07 21:57:53
Thanks. I'll look at it :)
Alxandr 2017-02-07 21:59:45
Lol, I went to register at hackage, and my password manager thought my username was ByteString.Lazy for some reason :P
filterfish 2017-02-07 22:00:13
;)
dmwit 2017-02-07 22:00:21
=)
tabaqui1 2017-02-07 22:02:02
there is no bool conversion in Haskell, right?
tabaqui1 2017-02-07 22:02:13
like "class isBool"
tabaqui1 2017-02-07 22:02:24
with "toBool :: a -> Bool"
tabaqui1 2017-02-07 22:02:34
for using in if-then-else syntax
erisco 2017-02-07 22:02:46
use case/of
davidar 2017-02-07 22:03:01
tabaqui1: see the Boolean package
tabaqui1 2017-02-07 22:03:14
case of takes much place
quchen 2017-02-07 22:04:02
> length "case x of True -> y; False -> z"
lambdabot 2017-02-07 22:04:05
31
tabaqui1 2017-02-07 22:04:09
wtf is "type family"?
quchen 2017-02-07 22:04:11
> length "if x then y else z"
lambdabot 2017-02-07 22:04:15
18
quchen 2017-02-07 22:04:17
Negligible.
erisco 2017-02-07 22:04:34
tabaqui, a function on types
tabaqui1 2017-02-07 22:05:01
erisco: never seen it before
tabaqui1 2017-02-07 22:05:25
it's not from haskell '98
erisco 2017-02-07 22:05:25
> length "bool y z x"
lambdabot 2017-02-07 22:05:28
10
tabaqui1 2017-02-07 22:05:33
davidar: looks fine, thx
erisco 2017-02-07 22:05:47
tabaqui, times have moved on
flxw 2017-02-07 22:06:44
Hi, I'm trying to compile an older version of category-extras. ghc (8.0.1) complains about this Span definition:
flxw 2017-02-07 22:06:47
newtype Span (~>) x y z = Span { runSpan :: (y ~> x, y ~> z) }
flxw 2017-02-07 22:07:07
is there an extension I need to switch on to make this valid syntax?
tabaqui1 2017-02-07 22:07:48
ah, ghc extension
tabaqui1 2017-02-07 22:07:50
well
flxw 2017-02-07 22:08:06
oops, yeah.
tabaqui1 2017-02-07 22:08:28
flxw: you cannot use polimorphic types in newtype
erisco 2017-02-07 22:08:46
flxw, TypeOperators maybe? what is the error?
bitonic 2017-02-07 22:08:53
flxw: what's the error? You need TypeOperators
tabaqui1 2017-02-07 22:08:59
newtype will be unboxed after compiling, it allows typecheck for compiler
tabaqui1 2017-02-07 22:09:18
but isn't a new datatype in bytecode
flxw 2017-02-07 22:09:18
flxw 2017-02-07 22:09:18
/tmp/stack10841/category-extras-0.53.5/src/Control/Morphism/Span.hs:20:14: error:
flxw 2017-02-07 22:09:18
Unexpected type `(~>)'
flxw 2017-02-07 22:09:18
In the newtype declaration for `Span'
flxw 2017-02-07 22:09:22
A newtype declaration should have form
flxw 2017-02-07 22:09:24
newtype Span a b c d = ...
erisco 2017-02-07 22:09:34
right, you cannot use newtypes recursively
erisco 2017-02-07 22:09:40
which is what I think tabaqui meant
bitonic 2017-02-07 22:10:03
erisco: there is no recursion there, I just think he needs TypeOperators
erisco 2017-02-07 22:10:31
oh I am wrong, you absolutely can :P
flxw 2017-02-07 22:10:36
okay, thank you. I'll try it out ...
erisco 2017-02-07 22:10:43
guess I was thinking of type aliases
erisco 2017-02-07 22:11:29
bitonic, ~> occurs in the definition of ~>
bitonic 2017-02-07 22:11:40
erisco: he's not defining ~>
erisco 2017-02-07 22:12:15
what is (~>) doing in the parameter list
erisco 2017-02-07 22:12:44
newtype Span x y z = Span { runSpan :: (y ~> x, y ~> z) }
kadoban 2017-02-07 22:13:24
Same thing newtype Span foo x y z = Span { runSpan :: (foo y x, foo y z)} would be doing I think, except fancy infix? Could be wrong though.
bitonic 2017-02-07 22:14:28
I'm pretty sure the problem here is that before you could have type operators like that
bitonic 2017-02-07 22:14:33
But now they must be prefixed with :
erisco 2017-02-07 22:14:38
you can use ~> as a parameter name? what do I know anymore lol
quchen 2017-02-07 22:15:44
> let (*) = (++) in "hello" * "erisco"
lambdabot 2017-02-07 22:15:46
"helloerisco"
bitonic 2017-02-07 22:15:58
Ah no, : is for type constructors only, not type parameters
erisco 2017-02-07 22:16:00
parameter name
bitonic 2017-02-07 22:16:17
I think using operator names for type parameters is just not allowed anymore flxw
bitonic 2017-02-07 22:16:31
So I'd just turn the ~> into a f or some other alphanumeric symbol
erisco 2017-02-07 22:16:37
> let f (*) = (*) + (*) in f 1 -- apparently so
lambdabot 2017-02-07 22:16:40
2
quchen 2017-02-07 22:16:44
> (\(*) x y = x * y) (++) "hello" "erisco"
kadoban 2017-02-07 22:16:44
That's why Category's types aren't as cute anymore, right?
lambdabot 2017-02-07 22:16:46
lambdabot 2017-02-07 22:16:46
parse error on input '='
lambdabot 2017-02-07 22:16:46
Perhaps you need a 'let' in a 'do' block?
kadoban 2017-02-07 22:16:48
:t (>>>)
lambdabot 2017-02-07 22:16:49
forall k (cat :: k -> k -> *) (a :: k) (b :: k) (c :: k). Category cat => cat a b -> cat b c -> cat a c
quchen 2017-02-07 22:16:49
> (\(*) x y -> x * y) (++) "hello" "erisco"
lambdabot 2017-02-07 22:16:51
"helloerisco"
kadoban 2017-02-07 22:16:56
"cat" and such
bitonic 2017-02-07 22:17:11
flxw: e.g. `newtype Span f x y z = Span { runSpan :: (f y x, f y z) }` should work
bitonic 2017-02-07 22:17:27
I vaguely recall this behavior changing a while back
kadoban 2017-02-07 22:18:39
Ya, I think so too, not really sure what time period.
quchen 2017-02-07 22:19:16
kadoban: Kind polymorphism is responsible for that
erisco 2017-02-07 22:19:25
works for terms but not for types… syntax
bitonic 2017-02-07 22:19:36
flxw: I think we can probably help you better knowing why you're trying to compile `category-extras` :P
flxw 2017-02-07 22:19:47
bitonic: Thanks alot. This did the trick.
erisco 2017-02-07 22:19:52
I have never seen that used in a term either
kadoban 2017-02-07 22:19:54
quchen: Oh is my example a different issue? Hmm
bitonic 2017-02-07 22:20:10
flxw: it's probably going to be quite a struggle to get it to compile
quchen 2017-02-07 22:20:12
kadoban: The ugly type of >>> is what I meant
erisco 2017-02-07 22:20:50
don't forget preceding ' is for promoted constructors
flxw 2017-02-07 22:20:56
now I just need to go over the whole source and replace funny characters in ty peparameters through an toherwise unused letter ...
erisco 2017-02-07 22:21:19
and magic hash
bitonic 2017-02-07 22:22:09
flxw: again, why are you trying to get `category-extras` to compile with GHC 8?
bitonic 2017-02-07 22:22:16
Maybe there's an easier path to your goal :P
erisco 2017-02-07 22:22:32
! for strict, ~ for lazy
erisco 2017-02-07 22:22:51
@ to bind… is that it? :P
opqdonut 2017-02-07 22:23:54
erisco: I'd call @ alias
quchen 2017-02-07 22:24:12
They're called »as-patterns«.
flxw 2017-02-07 22:24:16
yeah, I was about to ask. :) I'm trying to compile conal's reactive package
flxw 2017-02-07 22:24:17
http://hackage.haskell.org/package/reactive
flxw 2017-02-07 22:26:15
and cabal pulls in this version of category-extras when I use backjumps of 10000 and reorder-goals. :)
flxw 2017-02-07 22:27:31
with fewer back jumps cabal fails to construct the dependency tree.
bitonic 2017-02-07 22:27:39
flxw: ehhhh... you're experiencing the pain of not having reproducible builds (e.g. what stack/nix give you). The best attempt would probably be to use whatever GHC Conal was using to build it
bitonic 2017-02-07 22:27:50
Rather than GHC 8
bitonic 2017-02-07 22:28:02
Otherwise it's going to be quite a nightmare
flxw 2017-02-07 22:29:05
yeah, I tried stack init --solver on the reactive sources. (reactive is not on stackage)
bitonic 2017-02-07 22:31:18
flxw: the problem is that stack does not go as far back as GHC 6.10
flxw 2017-02-07 22:31:26
okay, then I'll go finding out which ghc version was used during that age.
bitonic 2017-02-07 22:31:57
flxw: I'd guess GHC 6.10 or 6.`1
bitonic 2017-02-07 22:32:04
or 6.12
flxw 2017-02-07 22:32:39
aahh, this explains why my attempt of compiling it with 7.8 failed, too ...
erisco 2017-02-07 22:33:32
jle`, gets a little trippy when Nats get promoted to kinds lol
flxw 2017-02-07 22:33:57
thanks very much again. I'll try with the 6 series now.
erisco 2017-02-07 22:40:49
jle`, I realised I made a slight error on my EqS constructor
erisco 2017-02-07 22:41:15
i.e. I have (n := n) -> 'S n := 'S n but why do I not have (n := m) -> 'S n := 'S m
erisco 2017-02-07 22:43:29
we can also be as simple as EqNat :: forall (n :: Nat). n := n