Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→ 502,152 events total
2020-11-25 13:36:09 adm joins (~adm@43.229.88.197)
2020-11-25 13:36:45 <dminuoso> https://www.google.com/search?client=firefox-b-d&q=haskell+ghc+mtimes&nfpr=1&sa=X&ved=2ahUKEwiKrtWd6J3tAhWu1VkKHc94DHEQvgUoAXoECAcQMA&biw=618&bih=638 this suggests it only ever occured in proposals
2020-11-25 13:36:46 <hseg> only difference in whether 0 input should error
2020-11-25 13:36:55 <hseg> https://gitlab.haskell.org/ghc/ghc/-/wikis/proposal/semigroup-monoid
2020-11-25 13:37:01 <ezzieyguywuf> hrm, "[a] -> [b] -> Map a b", seems like a common enough need, i.e. "zip to Map", but I don't see anything like this in hoogle.
2020-11-25 13:37:06 <dminuoso> And I cant find it in the git history of GHC
2020-11-25 13:37:07 <ezzieyguywuf> is there a good reason why it doesn't exist?
2020-11-25 13:37:13 <hseg> ah. have been reading too many propsals then
2020-11-25 13:37:17 <dminuoso> % :t zip
2020-11-25 13:37:17 <yahb> dminuoso: ; <interactive>:1:1: error:; Ambiguous occurrence `zip'; It could refer to; either `Data.List.NonEmpty.zip', imported from `Data.List.NonEmpty'; or `Prelude.zip', imported from `Prelude' (and originally defined in `GHC.List')
2020-11-25 13:37:20 star_cloud joins (~star_clou@ec2-34-220-44-120.us-west-2.compute.amazonaws.com)
2020-11-25 13:37:22 <tomsmeding> ezzieyguywuf: (Map.fromList .) . zip
2020-11-25 13:37:25 <dminuoso> % :t Prelude.zip
2020-11-25 13:37:26 <yahb> dminuoso: forall {a} {b}. [a] -> [b] -> [(a, b)]
2020-11-25 13:37:27 <hseg> ^
2020-11-25 13:37:30 <ezzieyguywuf> tomsmeding: nice.
2020-11-25 13:38:14 zaquest joins (~notzaques@5.128.210.178)
2020-11-25 13:39:00 <dminuoso> Anyway. Is there an alternative to haskell-src-exts for generating entire haskell modules? In particular I want quasiquoters and ideally support for comments and a pretty printer..
2020-11-25 13:39:10 <ezzieyguywuf> tomsmeding: why are the parentheses needed in that expresion?
2020-11-25 13:39:19 <ezzieyguywuf> how is it different from Map.fromList . zip?
2020-11-25 13:39:27 <hseg> :t Map.fromList . zip
2020-11-25 13:39:27 <dminuoso> ezzieyguywuf: take a look at the number of arugments to zip
2020-11-25 13:39:28 <lambdabot> error:
2020-11-25 13:39:28 <lambdabot> Not in scope: ‘Map.fromList’
2020-11-25 13:39:28 <lambdabot> Perhaps you meant one of these:
2020-11-25 13:39:32 <hseg> :t Data.Map.fromList . zip
2020-11-25 13:39:34 <lambdabot> error:
2020-11-25 13:39:34 <lambdabot> • Couldn't match type ‘[b0] -> [(a, b0)]’ with ‘[(k, a1)]’
2020-11-25 13:39:34 <lambdabot> Expected type: [a] -> [(k, a1)]
2020-11-25 13:39:34 <kindaro> merijn: so, why does `cabal build` skip `sdist` then?
2020-11-25 13:39:36 sh9 joins (~sh9@softbank060116136158.bbtec.net)
2020-11-25 13:40:02 <dminuoso> ezzieyguywuf: `(f .) . g` is just very dense for composing `f` after the second argument of `g`
2020-11-25 13:40:46 <ezzieyguywuf> dminuoso: what would be a non-dense way of writing it? i see that zip takes two arguments but I guess I didn't realize that `(.)` was limited to one-operator stuff
2020-11-25 13:40:55 <dminuoso> % :t let (.:) = (.) . (.) in Data.Map.Strict.fromList .: Prelude.zip
2020-11-25 13:40:56 <yahb> dminuoso: forall {k} {a}. Ord k => [k] -> [a] -> M.Map k a
2020-11-25 13:40:58 <dminuoso> This is a slightly more readable way
2020-11-25 13:41:15 <dminuoso> Or you just use lambdas, parens
2020-11-25 13:41:18 <dminuoso> extra binding
2020-11-25 13:42:41 <maerwald> is there a way in hspec to mark a test as flaky and still have it run, but when it fails just print a warning and not error?
2020-11-25 13:43:37 fendor_ joins (~fendor@178.165.131.166.wireless.dyn.drei.com)
2020-11-25 13:44:37 × boxscape quits (54a35f37@gateway/web/cgi-irc/kiwiirc.com/ip.84.163.95.55) (Ping timeout: 264 seconds)
2020-11-25 13:46:28 × fendor quits (~fendor@178.165.130.67.wireless.dyn.drei.com) (Ping timeout: 272 seconds)
2020-11-25 13:46:40 × adm quits (~adm@43.229.88.197) (Remote host closed the connection)
2020-11-25 13:46:50 <ezzieyguywuf> maerwald: I've used pending before, but haven't tried having a potentially failing test run but keep going.
2020-11-25 13:47:01 <ezzieyguywuf> maerwald: I guess you could add a check to the end of your test, and flip to True if needed?
2020-11-25 13:47:38 <maerwald> Well, that doesn't give me a warning
2020-11-25 13:48:37 <maerwald> https://github.com/hspec/hspec/issues/372
2020-11-25 13:49:26 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Quit: Connection closed)
2020-11-25 13:49:52 royal_screwup21 joins (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9)
2020-11-25 13:50:47 × FreeBirdLjj quits (~freebirdl@101.228.42.108) (Remote host closed the connection)
2020-11-25 13:50:55 <tomsmeding> ezzieyguywuf: (.) :: (b -> c) -> (a -> b) -> (a -> c); it's composition of single-argument functions
2020-11-25 13:52:10 FreeBirdLjj joins (~freebirdl@101.228.42.108)
2020-11-25 13:52:18 <tomsmeding> ((f .) . g) a b = (\x -> (f .) (g x)) a b = ((f .) (g a)) b = (f . g a) b = (\x -> f (g a x)) b = f (g a b)
2020-11-25 13:52:30 hackage hspec-hashable 0.1.0.1 - Initial project template from stack https://hackage.haskell.org/package/hspec-hashable-0.1.0.1 (mchaver)
2020-11-25 13:52:32 <tomsmeding> you can work it out by hand :)
2020-11-25 13:52:51 mputz joins (~Thunderbi@dslb-084-058-211-084.084.058.pools.vodafone-ip.de)
2020-11-25 13:53:32 × robotadam1 quits (~robotadam@s91904426.blix.com) (Remote host closed the connection)
2020-11-25 13:53:58 f-a joins (~f-a@151.68.213.48)
2020-11-25 13:54:44 × royal_screwup21 quits (52254809@gateway/web/cgi-irc/kiwiirc.com/ip.82.37.72.9) (Ping timeout: 260 seconds)
2020-11-25 13:55:28 urodna joins (~urodna@unaffiliated/urodna)
2020-11-25 13:56:51 <tomsmeding> ezzieyguywuf: another way to see the same thing: for (.) we have the property that (f . g) x = f (g x), so that means that ((f .) . g) a b = (((f .) . g) a) b = ... you can work it out :)
2020-11-25 13:56:56 × kindaro quits (5cf52cdd@h92-245-44-221.dyn.bashtel.ru) (Remote host closed the connection)
2020-11-25 13:58:16 <ezzieyguywuf> tomsmeding: lol, thank you.
2020-11-25 13:58:17 <dminuoso> To me, it's just an idiom that I know what it does without knowing why
2020-11-25 13:58:25 <dminuoso> I know I can do what tomsmeding did by hand too, just never bothered to
2020-11-25 13:58:39 <tomsmeding> at this point it's also an idiom I know :p
2020-11-25 13:58:52 <tomsmeding> I worked it out the first time I saw it though, because I was seriously confused back then
2020-11-25 13:58:58 <dminuoso> Heh. I prefer f .: g over (f .) . g though
2020-11-25 13:58:59 <ezzieyguywuf> if `test = [["abc", "def"], ["123", "456"]]` why does `[ header : body ] = test` result in a non-exhaustive pattern error?
2020-11-25 13:59:13 <tomsmeding> (header : body) = test
2020-11-25 13:59:38 <hseg> wait, Monad can no longer be defined in terms of join?
2020-11-25 13:59:48 <dminuoso> correct
2020-11-25 13:59:57 <hseg> :(
2020-11-25 14:00:02 <dminuoso> it caused segfaults left and right because of GeneralizedNewtypeDeriving
2020-11-25 14:00:08 f-a parts (~f-a@151.68.213.48) ()
2020-11-25 14:00:13 <dminuoso> well okay only on the left side of things
2020-11-25 14:00:16 <ezzieyguywuf> hrm,I think this is a function in Data.List actually...
2020-11-25 14:00:37 <dminuoso> hseg: https://ryanglscott.github.io/2018/03/04/how-quantifiedconstraints-can-let-us-put-join-back-in-monad/
2020-11-25 14:01:02 <dminuoso> It's a pretty wild story, at first it seemed so unlikely how join in Monad could cause segfaults with GeneralizedNewtypeDeriving
2020-11-25 14:01:23 honigkuchen joins (~honigkuch@ip5b42981b.dynamic.kabel-deutschland.de)
2020-11-25 14:01:36 cosimone joins (~cosimone@2001:b07:ae5:db26:d849:743b:370b:b3cd)
2020-11-25 14:01:38 × mputz quits (~Thunderbi@dslb-084-058-211-084.084.058.pools.vodafone-ip.de) (Quit: mputz)
2020-11-25 14:01:43 <hseg> ok, thanks
2020-11-25 14:01:57 <honigkuchen> are there particular broader tasks in that functional programming languages or paradigms are better?
2020-11-25 14:02:23 <honigkuchen> instead of answering a link can also help
2020-11-25 14:02:57 <tdammers> bit of a vague question - to begin with, there isn't really a narrow definition of "functional programming" that enjoys a wide consensus
2020-11-25 14:03:29 <honigkuchen> tdammers, is that an answer to me?
2020-11-25 14:03:32 <tdammers> yes
2020-11-25 14:03:53 <honigkuchen> tdammers, I do not care about an exact definination what functional programming is
2020-11-25 14:04:23 <tdammers> OK, but if you look at languages that are sometimes labelled as "functional", there is quite some difference in where they shine
2020-11-25 14:04:25 <Digit> tomsmeding: no ghcup. am using different bedrocklinux strata for different ghc versions.
2020-11-25 14:04:31 hackage ukrainian-phonetics-basic 0.3.1.0 - A library to work with the basic Ukrainian phonetics and syllable segmentation. https://hackage.haskell.org/package/ukrainian-phonetics-basic-0.3.1.0 (OleksandrZhabenko)
2020-11-25 14:05:28 <tdammers> for example, scheme makes for a great scripting language, but lacks the type discipline you want in situations where you need a high degree of certainty about the code's properties, which in turn is something Haskell is good at
2020-11-25 14:06:01 <honigkuchen> tdammers, lets forget all these others and only take haskell
2020-11-25 14:06:30 coot_ joins (~coot@37.30.49.253.nat.umts.dynamic.t-mobile.pl)
2020-11-25 14:06:38 <maerwald> no :p
2020-11-25 14:06:45 <Digit> honigkuchen: wouldnt that be nice. :) lisps linger long though. n_n
2020-11-25 14:07:00 hackage vulkan-utils 0.3 - Utils for the vulkan package https://hackage.haskell.org/package/vulkan-utils-0.3 (jophish)
2020-11-25 14:07:03 <honigkuchen> may it be that certain tasks are better for imperative languages and others are better for haskell
2020-11-25 14:07:25 × Kaivo quits (~Kaivo@ec2-15-222-231-32.ca-central-1.compute.amazonaws.com) (Ping timeout: 240 seconds)

All times are in UTC.