Logs: freenode/#haskell
| 2020-09-19 01:43:54 | <monochrom> | Or rather: |
| 2020-09-19 01:44:32 | <monochrom> | If you intend function definition, the grammar doesn't anticipate parenthesizing such as "(f x) = x+1" |
| 2020-09-19 01:45:26 | <boxscape> | % f :: a -> b -> a; (f a) b = a |
| 2020-09-19 01:45:26 | <yahb> | boxscape: |
| 2020-09-19 01:45:31 | <monochrom> | BUT! The other kind of definitions is "pattern = expr". In this case, the pattern can have outermost parentheses, "(inner pattern) = expr" because all patterns allow redundant parentheses. |
| 2020-09-19 01:45:51 | <boxscape> | oh, yeah, I suppose that does make sense |
| 2020-09-19 01:46:01 | <boxscape> | thanks |
| 2020-09-19 01:46:02 | <monochrom> | This pushes the parser to look at "(a +++ b) = ..." and go "ah, you have a pattern on the LHS". |
| 2020-09-19 01:46:07 | <boxscape> | right |
| 2020-09-19 01:47:13 | → | kenran joins (~maier@b2b-37-24-119-190.unitymedia.biz) |
| 2020-09-19 01:48:32 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-09-19 01:52:36 | × | kenran quits (~maier@b2b-37-24-119-190.unitymedia.biz) (Ping timeout: 272 seconds) |
| 2020-09-19 01:53:52 | × | Rudd0 quits (~Rudd0@185.189.115.108) (Remote host closed the connection) |
| 2020-09-19 01:56:09 | → | nineonine joins (~nineonine@216-19-190-182.dyn.novuscom.net) |
| 2020-09-19 01:59:14 | → | falafel joins (~falafel@2605:e000:1527:d491:f090:20fe:cddf:2a1a) |
| 2020-09-19 01:59:20 | <ski> | yea, i've noticed this discrepance before |
| 2020-09-19 02:00:57 | × | nineonine quits (~nineonine@216-19-190-182.dyn.novuscom.net) (Ping timeout: 260 seconds) |
| 2020-09-19 02:01:28 | <ski> | occasionally, i've wanted to do something like `( x +++ Foo) = ...', in order to align `x' with something on another line |
| 2020-09-19 02:01:53 | <monochrom> | That's clever |
| 2020-09-19 02:02:11 | <monochrom> | Use explicit { ; } >:) |
| 2020-09-19 02:02:38 | <ski> | this was directly under `module', as i recall it |
| 2020-09-19 02:05:45 | <monochrom> | module M where { |
| 2020-09-19 02:05:54 | × | theDon quits (~td@94.134.91.38) (Ping timeout: 272 seconds) |
| 2020-09-19 02:07:09 | → | theDon joins (~td@94.134.91.50) |
| 2020-09-19 02:08:35 | × | bloodsta1ker quits (~bloodstal@46.166.187.178) (Remote host closed the connection) |
| 2020-09-19 02:12:47 | <eflister> | i need an accumulating traverse for Data.Map. |
| 2020-09-19 02:12:55 | lagothrix | is now known as Guest51064 |
| 2020-09-19 02:12:55 | × | Guest51064 quits (~lagothrix@unaffiliated/lagothrix) (Killed (weber.freenode.net (Nickname regained by services))) |
| 2020-09-19 02:13:08 | → | lagothrix joins (~lagothrix@unaffiliated/lagothrix) |
| 2020-09-19 02:15:24 | × | falafel quits (~falafel@2605:e000:1527:d491:f090:20fe:cddf:2a1a) (Remote host closed the connection) |
| 2020-09-19 02:15:48 | → | falafel joins (~falafel@2605:e000:1527:d491:f090:20fe:cddf:2a1a) |
| 2020-09-19 02:15:56 | <ski> | eflister : use `StateT' ? |
| 2020-09-19 02:16:19 | → | TooDifficult joins (~TooDiffic@139.59.59.230) |
| 2020-09-19 02:18:18 | <eflister> | ski: makes sense. any idea why it's not included in the library? makes me suspect i'm doing something wrong :) |
| 2020-09-19 02:18:44 | <ski> | not included in which library ? |
| 2020-09-19 02:18:57 | hackage | arch-hs 0.0.0.0 - A program generating PKGBUILD for hackage packages. https://hackage.haskell.org/package/arch-hs-0.0.0.0 (berberman) |
| 2020-09-19 02:18:58 | <eflister> | Data.Map :) |
| 2020-09-19 02:19:18 | <ski> | (also, you said you were going to make a paste before, but you never showed any paste link) |
| 2020-09-19 02:20:14 | <eflister> | heh, good memory - i later posted that i found a missing $ after lunch :) |
| 2020-09-19 02:20:47 | <ski> | eflister : well, it has `instance Traversable (Map k)'. what more do you need, than that, and `instance Monad m => Applicative (StateT s m)' ? |
| 2020-09-19 02:20:52 | × | mozzarella quits (~sam@unaffiliated/sam113101) (Read error: Connection reset by peer) |
| 2020-09-19 02:23:00 | <ski> | @type (runStateT .) . (. (id :: M.Map k v -> M.Map k v)) . traverse . (StateT .) |
| 2020-09-19 02:23:00 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 272 seconds) |
| 2020-09-19 02:23:02 | <lambdabot> | Monad m => (v -> s -> m (b, s)) -> M.Map k v -> s -> m (M.Map k b, s) |
| 2020-09-19 02:23:09 | <ski> | you wanted something like that ? |
| 2020-09-19 02:23:10 | × | jumper149 quits (~jumper149@ip185225.wh.uni-hannover.de) (Quit: WeeChat 2.9) |
| 2020-09-19 02:23:21 | × | jneira_ quits (~jneira@80.30.101.206) (Ping timeout: 260 seconds) |
| 2020-09-19 02:23:50 | → | mozzarella joins (~sam@unaffiliated/sam113101) |
| 2020-09-19 02:23:52 | → | jneira_ joins (~jneira@80.30.101.206) |
| 2020-09-19 02:24:49 | × | falafel quits (~falafel@2605:e000:1527:d491:f090:20fe:cddf:2a1a) (Remote host closed the connection) |
| 2020-09-19 02:26:16 | → | falafel joins (~falafel@2605:e000:1527:d491:f090:20fe:cddf:2a1a) |
| 2020-09-19 02:27:23 | × | miklcct quits (quasselcor@2001:19f0:7001:5ad:5400:2ff:feb6:50d7) (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
| 2020-09-19 02:27:54 | <eflister> | that does look good, but more sophisticated than i usually get. :) since they have mapAccum and traverse i was hoping they'd baked in the combination... |
| 2020-09-19 02:28:52 | → | booppoob joins (uid425746@gateway/web/irccloud.com/x-zxeyoiczknyxztoh) |
| 2020-09-19 02:29:38 | <booppoob> | hi, do you think i should learn haskell if i have absolutely no maths background? does one need one to be able to have an easier time? |
| 2020-09-19 02:29:49 | <booppoob> | should I instead spend some time with maths before coming to it? |
| 2020-09-19 02:30:56 | → | drbean joins (~drbean@TC210-63-209-205.static.apol.com.tw) |
| 2020-09-19 02:32:24 | <boxscape> | You do not need a maths background to learn haskell |
| 2020-09-19 02:32:28 | → | miklcct joins (quasselcor@2001:19f0:7001:5ad:5400:2ff:feb6:50d7) |
| 2020-09-19 02:32:38 | → | vnogueira joins (~vnogueira@unaffiliated/vnogueira) |
| 2020-09-19 02:33:08 | × | jneira_ quits (~jneira@80.30.101.206) (Ping timeout: 272 seconds) |
| 2020-09-19 02:33:32 | <ski> | eflister : just write something like `(`runState` initialAcc) (traverse (\val -> StateT (\acc -> do ...; return (newVal,newAcc))) myMap)' |
| 2020-09-19 02:34:20 | <ski> | (er, s/runState/runStateT/) |
| 2020-09-19 02:34:41 | ← | vnogueira parts (~vnogueira@unaffiliated/vnogueira) () |
| 2020-09-19 02:34:53 | <ski> | (`mapAccumL' is just `traverse' on `State s') |
| 2020-09-19 02:34:54 | → | jneira_ joins (~jneira@80.30.101.206) |
| 2020-09-19 02:34:57 | <booppoob> | ok, my friend(s) keep telling me only maths people do it. that's reassuring to hear. |
| 2020-09-19 02:35:59 | <boxscape> | heh, it does tend to attract maths people. There are some nice relationships between some Haskell concepts and some maths concepts, but I doubt most people who have learned haskell even heard about those math concepts before. |
| 2020-09-19 02:36:01 | <ski> | @where prerequisite |
| 2020-09-19 02:36:01 | <lambdabot> | "Prerequisite for Learning Haskell" <http://www.vex.net/~trebla/haskell/prerequisite.xhtml> |
| 2020-09-19 02:36:06 | <ski> | booppoob : see ^ |
| 2020-09-19 02:36:44 | <ski> | that tells you what (little) math background is useful, for learning Haskell |
| 2020-09-19 02:37:16 | <dolio> | I think people have taught Haskell to high school students. Possibly grade school. |
| 2020-09-19 02:38:25 | <boxscape> | I wasn't taught it *in* high school but I did learn it while I was attending high school |
| 2020-09-19 02:40:57 | × | Turmfalke quits (~user@unaffiliated/siracusa) (Quit: Bye!) |
| 2020-09-19 02:42:18 | <boxscape> | hm I feel like that prerequisites page could benefit from some LaTeX, the ASCII math makes it look more difficult than it is |
| 2020-09-19 02:42:53 | → | ahmr88 joins (~ahmr88@cpc85006-haye22-2-0-cust131.17-4.cable.virginm.net) |
| 2020-09-19 02:43:00 | <ski> | hm, not the other way around, then ? |
| 2020-09-19 02:43:17 | <boxscape> | well, I'm not suggesting to show the LaTeX source, but the rendered result |
| 2020-09-19 02:43:45 | <boxscape> | though you may have meant that |
| 2020-09-19 02:43:53 | <ski> | yes |
| 2020-09-19 02:44:19 | ski | looks at monochrom |
| 2020-09-19 02:44:36 | <monochrom> | All LaTeX does in this case is merely italicize. |
| 2020-09-19 02:44:40 | <boxscape> | I don't know, maybe - my impression would be that as long as you only use letters and numbers and not greek letters it shouldn't be any more menacing than ASCII math, but I could be wrong |
| 2020-09-19 02:44:46 | <ski> | monochrom : and superscripts |
| 2020-09-19 02:44:55 | <boxscape> | yeah I was thinking mostly of superscripts and asterisks |
| 2020-09-19 02:45:03 | × | ericsagnes quits (~ericsagne@2405:6580:0:5100:604a:a4e7:7f40:e8c2) (Ping timeout: 272 seconds) |
| 2020-09-19 02:45:04 | <boxscape> | though then again |
| 2020-09-19 02:45:18 | <boxscape> | I suppose the asterisks are a deliberate choice because juxtaposition is an ASCII feature |
| 2020-09-19 02:46:55 | <boxscape> | and I admit it could be jarring once you get to the source code which presumably would be rendered without LaTeX |
| 2020-09-19 02:47:35 | × | ahmr88 quits (~ahmr88@cpc85006-haye22-2-0-cust131.17-4.cable.virginm.net) (Ping timeout: 272 seconds) |
| 2020-09-19 02:47:47 | × | gestone quits (~gestone@c-73-97-137-216.hsd1.wa.comcast.net) (Ping timeout: 258 seconds) |
| 2020-09-19 02:49:21 | → | gestone joins (~gestone@c-73-97-137-216.hsd1.wa.comcast.net) |
| 2020-09-19 02:49:58 | <booppoob> | ok, i think i am done with the prerequisites, what would you suggest as a starting point to learn? which book should i begin with? |
| 2020-09-19 02:50:25 | × | nckx quits (~nckx@tobias.gr) (Quit: Updating my Guix System — https://guix.gnu.org) |
| 2020-09-19 02:51:08 | → | nckx joins (~nckx@tobias.gr) |
| 2020-09-19 02:51:35 | → | merijn joins (~merijn@83-160-49-249.ip.xs4all.nl) |
| 2020-09-19 02:52:34 | → | da39a3ee5e6b4b0d joins (~textual@mx-ll-171.5.162-140.dynamic.3bb.co.th) |
| 2020-09-19 02:52:41 | <boxscape> | booppoob In terms of free resources, this seems to be a pretty good introduction https://www.seas.upenn.edu/~cis194/spring13/lectures.html In terms of paid resources, there's haskellbook.com |
| 2020-09-19 02:53:37 | <sshine> | LaTeX also provides nice combined glyphs for "fi" and so on. |
All times are in UTC.