Home liberachat/#haskell: Logs Calendar

Logs: liberachat/#haskell

←Prev  Next→ 1,803,858 events total
2021-07-29 18:49:31 <lambdabot> <IO ()>
2021-07-29 18:49:37 <roboguy_> ah, you got it EvanR
2021-07-29 18:49:51 <roboguy_> there are runtime type errors. that's one big reason you could dislike it
2021-07-29 18:50:06 <roboguy_> also, you could probably improve the interface so that is impossible...
2021-07-29 18:50:45 <EvanR> stringing together strings is much more conceptually simplee
2021-07-29 18:50:47 <lechner> my big issue, as a beginner, is that with putStrLn lines get very long, and right now, my style has some serious problems
2021-07-29 18:51:01 <lechner> i now use a code formatter
2021-07-29 18:51:01 <EvanR> if printf works then use it
2021-07-29 18:51:22 <roboguy_> I usually write putStrLn $ "some text " ++ show x ++ " .... " ++ show y ++ ...
2021-07-29 18:51:23 <lechner> i will have multiple iterations of this program
2021-07-29 18:51:49 × burnsidesLlama quits (~burnsides@client-8-91.eduroam.oxuni.org.uk) (Remote host closed the connection)
2021-07-29 18:51:54 <Drew[m]> roboguy_: I wouldn't be surprised if there's already a library with type-safe formatting template representation
2021-07-29 18:52:14 <roboguy_> Drew[m]: same. I feel like I've actually seen one, but I don't quite remember
2021-07-29 18:52:21 burnsidesLlama joins (~burnsides@client-8-91.eduroam.oxuni.org.uk)
2021-07-29 18:52:53 <lechner> i also give imperative name to functions. does that condition have a name. is there a cure?
2021-07-29 18:53:03 <EvanR> wait
2021-07-29 18:53:03 <lechner> names
2021-07-29 18:53:11 <EvanR> i didn't even get a runtime type error
2021-07-29 18:53:16 <EvanR> > printf "%s" (123 :: Int) :: String
2021-07-29 18:53:17 <lambdabot> "*Exception: printf: bad formatting char 's'
2021-07-29 18:53:24 <EvanR> oh i see, no closing "
2021-07-29 18:53:33 × tput quits (~tim@S0106a84e3fe54613.ed.shawcable.net) (Ping timeout: 268 seconds)
2021-07-29 18:53:39 <Drew[m]> lechner: Er what's an example of an imperative name?
2021-07-29 18:53:40 <roboguy_> lechner: imperative names?
2021-07-29 18:53:51 <EvanR> at first i thought it was a horribad way out of the error
2021-07-29 18:54:25 <lechner> processTask sendProduct updateTool getTool getConfig
2021-07-29 18:54:29 <EvanR> function names that happen to be a verb?
2021-07-29 18:54:49 tput joins (~tim@S0106a84e3fe54613.ed.shawcable.net)
2021-07-29 18:55:00 <Drew[m]> If `processTask` processes a task I wouldn't be bothered
2021-07-29 18:55:10 <EvanR> at least it's not the kingdom of nouns
2021-07-29 18:55:10 <roboguy_> lechner: those sound fine to me
2021-07-29 18:55:30 Obo joins (~roberto@70.pool90-171-81.dynamic.orange.es)
2021-07-29 18:55:33 <roboguy_> in fact, probably what I would use (and often see used in other Haskell projects)
2021-07-29 18:55:42 <EvanR> NounVerber
2021-07-29 18:55:48 × mattil quits (~mattilinn@87-92-17-82.bb.dnainternet.fi) (Quit: Leaving)
2021-07-29 18:55:55 <Drew[m]> taskProcessor would upset me
2021-07-29 18:56:00 <lechner> used as an imperative. i think English uses plain verb as the imperative
2021-07-29 18:56:10 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 240 seconds)
2021-07-29 18:56:31 <EvanR> what language is your program in
2021-07-29 18:56:39 <roboguy_> oh, "imperative" in the sense of natural languages like English, not the programming language notion?
2021-07-29 18:56:41 <lechner> Haskell
2021-07-29 18:56:49 <EvanR> like, not english?
2021-07-29 18:56:51 fossdd joins (~fossdd@sourcehut/user/fossdd)
2021-07-29 18:56:51 <lechner> well, English
2021-07-29 18:57:22 × burnsidesLlama quits (~burnsides@client-8-91.eduroam.oxuni.org.uk) (Ping timeout: 272 seconds)
2021-07-29 18:58:10 <lechner> sorry, like the AD thing with the other fellow earlier i am fighting the remnants of imperative programming in my mind, or so i think
2021-07-29 18:58:12 <EvanR> haskell is cool for having a variety of grammatical types... nouns, verbs, prepositions
2021-07-29 18:58:19 <Drew[m]> When you write `processTask task` what are you doing? Processing a task called `task`
2021-07-29 18:58:19 <Drew[m]> When you write `taskProcessor task` are you task processoring a task?
2021-07-29 18:58:27 <lechner> yes
2021-07-29 18:58:42 <lechner> they are all monadic
2021-07-29 18:58:48 <lechner> but still
2021-07-29 18:58:49 <EvanR> send task taskProcessor
2021-07-29 18:59:38 qbt joins (~edun@user/edun)
2021-07-29 18:59:50 <EvanR> taskProcessor <- createThingDoer processTask
2021-07-29 19:00:58 <EvanR> when you get into non IO monads I can see how not using verbs will confuse people
2021-07-29 19:01:20 <EvanR> in pure code, non verbs seems more natural
2021-07-29 19:01:25 vicfred joins (~vicfred@user/vicfred)
2021-07-29 19:01:31 <roboguy_> lechner: that all seems fine to me. In general, I wouldn't worry as much about "avoiding doing it the imperative way" and focus more on "doing it the Haskell way"
2021-07-29 19:01:33 <roboguy_> if that makes sense
2021-07-29 19:02:00 <roboguy_> sometimes the Haskell way involves some imperative-style stuff. Sometimes it does not
2021-07-29 19:02:34 <Drew[m]> Imo verbs are fine in pure code. I mean we `map` and `filter` and `sum` do we not?
2021-07-29 19:02:47 <lechner> this is my second Haskell program. it works just like the Perl version, but my style is terrible. i think i use the wrong entry points to separate the parts https://dpaste.org/RGJQ
2021-07-29 19:02:50 <EvanR> all three of those could be nouns xD
2021-07-29 19:02:56 <roboguy_> yeah, without verbs in names it would be very confusing
2021-07-29 19:02:58 × fossdd quits (~fossdd@sourcehut/user/fossdd) (Ping timeout: 240 seconds)
2021-07-29 19:03:05 × hyiltiz quits (~quassel@31.220.5.250) (Ping timeout: 265 seconds)
2021-07-29 19:03:06 <Drew[m]> map, mapped, mapping, sum, summed, summing
2021-07-29 19:03:11 fossdd joins (~fossdd@sourcehut/user/fossdd)
2021-07-29 19:03:15 hyiltiz joins (~quassel@31.220.5.250)
2021-07-29 19:03:20 <EvanR> it's unclear if map, filter, or sum ought to be construed as verbs or not
2021-07-29 19:03:22 <EvanR> to me
2021-07-29 19:03:37 <EvanR> never even thought about it until now lol
2021-07-29 19:03:55 <Drew[m]> I read `map x y` as "map x (over) y`
2021-07-29 19:04:07 <EvanR> sure that's one way to think of it
2021-07-29 19:04:12 <Drew[m]> What about compose
2021-07-29 19:04:20 <Drew[m]> we don't call it the composer function
2021-07-29 19:04:32 <Drew[m]> and we don't think of "a compose"
2021-07-29 19:04:41 <EvanR> in purely math areas, the math really has nothing to do with grammar
2021-07-29 19:04:51 <EvanR> compose could just be the name of an operator
2021-07-29 19:05:03 <EvanR> it could have been known as composition
2021-07-29 19:05:04 <deejaytee> we think of a composition, though
2021-07-29 19:05:06 × ddb quits (~ddb@2607:5300:61:c67::196) (Ping timeout: 240 seconds)
2021-07-29 19:05:06 <lechner> haskell can flow well, though
2021-07-29 19:06:09 <lechner> conditionals are my other problem. i am kind of Either'ed out
2021-07-29 19:06:50 <EvanR> a functor for example could be seen as an action that sends things from C to D, or the act of lifting arrows so they can act between categories
2021-07-29 19:07:06 <lechner> plus, i have poor vision and ten indent levels are too much. maybe i should write shorter functions
2021-07-29 19:07:18 <EvanR> i rarely have more than 1 or 2 indent levels
2021-07-29 19:07:25 <EvanR> where clauses can help there
2021-07-29 19:07:28 ddb joins (~ddb@2607:5300:61:c67::196)
2021-07-29 19:07:51 <lechner> that may be hint i needed
2021-07-29 19:07:54 <lechner> the
2021-07-29 19:08:46 burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk)
2021-07-29 19:09:16 <Drew[m]> Yes you can have a filter, a sum and a map but in the context of `map` wouldn't the correct noun be a mapper or mapping? "A map" as a noun makes me think of atlases more than well... a mapping from input to output
2021-07-29 19:09:18 <echoone> You guys should check out APL. The take the grammar stuff seriously.
2021-07-29 19:09:24 <echoone> You guys should check out APL. They take the grammar stuff seriously.
2021-07-29 19:09:35 <dsal> :t get
2021-07-29 19:09:36 <lambdabot> MonadState s m => m s
2021-07-29 19:09:48 × burnsidesLlama quits (~burnsides@dhcp168-019.wadham.ox.ac.uk) (Remote host closed the connection)
2021-07-29 19:10:07 burnsidesLlama joins (~burnsides@dhcp168-019.wadham.ox.ac.uk)

All times are in UTC.