reactormonk 2017-01-28 05:48:36
"Failed to load interface for `Network.URI`, It is a member of the hidden package" - huh?
reactormonk 2017-01-28 05:48:45
What does "hidden package" mean?
hpc 2017-01-28 05:48:56
which hidden package?
reactormonk 2017-01-28 05:49:05
network-uri-2.6.1.0
reactormonk 2017-01-28 05:49:15
ah, it's in the cabal faq, oops
kadoban 2017-01-28 05:49:15
reactormonk: You haven't declared the dependency in your .cabal file (in the correct place)
reactormonk 2017-01-28 05:49:53
ah, terminology. kk.
reactormonk 2017-01-28 05:50:09
aka ghc knows about it, but you haven't told it to use the package.
monochrom 2017-01-28 05:50:42
cabal tells GHC to hide away all packages not listed. "hide" means pretend not to see.
kadoban 2017-01-28 05:51:34
It's pretty far from the best error wording ever, but the layers of indirection involved seem to make it hard to improve it.
suppi 2017-01-28 05:51:47
how can i show a NominalDiffTime in a HH:mm format?
reactormonk 2017-01-28 05:52:30
kadoban, still better than T_PAAMAYIM_NEKUDOTAYIM - although that's beating midgets :-)
kadoban 2017-01-28 05:52:40
Hehe, yes
suppi 2017-01-28 05:53:06
why does that type even exist. I don't see how i can use it for anything useful. why not just have DiffTime?
reactormonk 2017-01-28 05:53:11
What's the stack command to refresh dependencies?
hpc 2017-01-28 05:53:59
suppi: NominalDiffTime measures stopwatch seconds
kadoban 2017-01-28 05:54:00
reactormonk: stack build --only-dependencies or something you mean? Not needed basically ever though. Usually you just build again normally, or whatever your actual goal is.
reactormonk 2017-01-28 05:54:11
oke
hpc 2017-01-28 05:54:12
suppi: contrast with different types that measure clock time
suppi 2017-01-28 05:54:54
hpc: hpc any idea how i can show that in HH:mm format?
suppi 2017-01-28 05:55:12
I basically have two UTCTime values and i want to show their diff in HH:mm format
hpc 2017-01-28 05:55:51
you'll have to do math on it iirc
hpc 2017-01-28 05:56:05
it has numeric type class instances that you can work with, look just below it in the haddock for a list
suppi 2017-01-28 05:56:48
hpc: thanks
hpc 2017-01-28 05:57:01
also i had it backwards
hpc 2017-01-28 05:57:11
DiffTime is stopwatch seconds, NominalDiffTime is UTC seconds
hpc 2017-01-28 05:59:11
improving those names would involve deciding what they should be, and then doing the whole deprecation thing
suppi 2017-01-28 05:59:16
hpc: if you know how to convert it to Integer that'd be great :)
hpc 2017-01-28 05:59:33
:k NominalDiffTime
lambdabot 2017-01-28 05:59:35
error:
lambdabot 2017-01-28 05:59:35
Not in scope: type constructor or class 'NominalDiffTime'
suppi 2017-01-28 05:59:35
i don't care about precision much
hpc 2017-01-28 05:59:37
:(
suppi 2017-01-28 05:59:52
http://hackage.haskell.org/package/time-1.7.0.1/docs/Data-Time-Clock.html#t:NominalDiffTime
hpc 2017-01-28 06:00:02
floor (0 :: NominalDiffTime) :: Integer
hpc 2017-01-28 06:00:06
0
hpc 2017-01-28 06:00:16
#hashtag-num-instances
suppi 2017-01-28 06:01:02
hpc: bless you
reactormonk 2017-01-28 06:02:00
Is there something like ShowS -> ByteString ?
hpc 2017-01-28 06:02:42
(String -> String) -> ByteString?
reactormonk 2017-01-28 06:02:51
Yeah
hpc 2017-01-28 06:03:01
:t BSC.pack (fix show)
lambdabot 2017-01-28 06:03:03
BSC.ByteString
hpc 2017-01-28 06:03:11
:t \show -> BSC.pack (fix show)
lambdabot 2017-01-28 06:03:14
(String -> String) -> BSC.ByteString
hpc 2017-01-28 06:03:19
voila!
glguy 2017-01-28 06:03:19
You can apply the function to "", and then pack that into a ByteString either with the .Char8 module, or with utf8-string's encode function
monochrom 2017-01-28 06:03:36
:)
hpc 2017-01-28 06:04:21
conveniently, that applied to show isn't even bottom
hpc 2017-01-28 06:04:32
because lazy bytestrings are chunked
miladz89 2017-01-28 06:04:41
quick question? what is the best testing setup to use with haskell projects?
glguy 2017-01-28 06:05:09
hpc: Unless the ShowS was 'id'!
hpc 2017-01-28 06:05:18
glguy: applied to show ;)
glguy 2017-01-28 06:06:03
Oh, I didn't realize you were talking about a new ShowS
hpc 2017-01-28 06:06:43
it's parameterized by ShowS, so it can take whatever you give it
hpc 2017-01-28 06:06:47
and if you give it show it's defined
hpc 2017-01-28 06:06:56
(it is indeed bottom with id though)
hpc 2017-01-28 06:07:16
and i just named the parameter show because i don't know how to type new lines in irssi
hpc 2017-01-28 06:07:21
i press up and then change what i need
glguy 2017-01-28 06:07:42
Yeah, I see what you changed
reactormonk 2017-01-28 06:12:35
:t fix
lambdabot 2017-01-28 06:12:37
(a -> a) -> a
hpc 2017-01-28 06:15:06
> fix show
lambdabot 2017-01-28 06:15:09
"\"\\\"\\\\\\\"\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\...
reactormonk 2017-01-28 06:20:23
So I have `Maybe URI`, `URI -> ShowS` and the above function, how should I combine them?
reactormonk 2017-01-28 06:20:45
fmap + . ?
glguy 2017-01-28 06:23:38
reactormonk: Just start by using case
reactormonk 2017-01-28 06:25:06
glguy, I don't really care about the Nothing case.
hpc 2017-01-28 06:25:45
you... kind of have to
hpc 2017-01-28 06:26:08
if the Nothing case truly doesn't matter, you have URI instead of Maybe URI
hpc 2017-01-28 06:26:49
unless you mean you want mysteryShow Nothing = "" or something
reactormonk 2017-01-28 06:28:55
Ah no, a Maybe ByteString is the desired result.
hpc 2017-01-28 06:29:48
at this point i recommend you write out the complete type signature of what you want to define
hpc 2017-01-28 06:30:12
and at that point the code usually writes itself
monochrom 2017-01-28 06:36:11
No no, do it the other way round. Write the code first, then the types will write themselves (aka type inference) XD
dsfox 2017-01-28 06:36:22
Hello all - I'm having difficulty understanding how GHC.Generics is a replacement for Data.Generics. How do I get information about the type apart from a particular value? E.g. the list of a type's constructors, or the list of a constructor's field types?
monochrom 2017-01-28 06:36:46
No, I don't think they're replacement of each other.
glguy 2017-01-28 06:36:56
dsfox: Why do you think you need a value of the type to get that information?
reactormonk 2017-01-28 06:37:14
:t ((uriToString id) .> (\shows -> BS.pack (fix shows)))
lambdabot 2017-01-28 06:37:16
error:
lambdabot 2017-01-28 06:37:16
Variable not in scope:
lambdabot 2017-01-28 06:37:16
uriToString :: (a0 -> a0) -> BSC.ByteString -> r
dsfox 2017-01-28 06:37:26
glguy: I just haven't found a way using GHC.Generics
glguy 2017-01-28 06:37:44
http://lpaste.net/167793 (one version with TypeApplications and one without)
dsfox 2017-01-28 06:38:20
monochrom: do you mean one should keep using Data.Data?
reactormonk 2017-01-28 06:38:21
... how can I ask lambdabot to import something?
monochrom 2017-01-28 06:38:57
No.
glguy 2017-01-28 06:39:02
dsfox: GHC.Generics and Data.Data are good at different things
kadoban 2017-01-28 06:39:47
reactormonk: @let import Whatever
reactormonk 2017-01-28 06:40:08
@let import Network.URI
lambdabot 2017-01-28 06:40:10
Defined.
reactormonk 2017-01-28 06:40:15
@let import Flow
lambdabot 2017-01-28 06:40:16
.L.hs:135:1: error:
lambdabot 2017-01-28 06:40:16
Failed to load interface for 'Flow'
lambdabot 2017-01-28 06:40:16
Use -v to see a list of the files searched for.
kadoban 2017-01-28 06:40:22
reactormonk: No idea how often it'll actually work though, it's not going to let you arbitrarily bring in packages it doesn't have whitelisted or however that works.
reactormonk 2017-01-28 06:41:32
@let import import Control.Category ((>>>))
lambdabot 2017-01-28 06:41:32
Parse failed: Parse error: import
reactormonk 2017-01-28 06:41:39
@let import Control.Category ((>>>))
lambdabot 2017-01-28 06:41:40
Defined.
reactormonk 2017-01-28 06:41:48
:t ((uriToString id) >>> (\shows -> BS.pack (fix shows)))
lambdabot 2017-01-28 06:41:50
error:
lambdabot 2017-01-28 06:41:50
• Couldn't match type 'Char' with 'Word8'
lambdabot 2017-01-28 06:41:50
Expected type: ShowS -> BSC.ByteString
reactormonk 2017-01-28 06:41:58
^ yeah.
dsfox 2017-01-28 06:42:13
glguy: that makes me sad
glguy 2017-01-28 06:42:31
weird, I like that they do different things. It means I can do more things
reactormonk 2017-01-28 06:44:08
How do I make that typecheck? I think I'm using the combinators incorrectly.
dsfox 2017-01-28 06:44:33
jk, but I keep hearing that Data.Data is much slower than GHC.Generics