Logs: freenode/#haskell
| 2020-09-24 14:13:25 | × | nineonin_ quits (~nineonine@50.216.62.2) (Ping timeout: 264 seconds) |
| 2020-09-24 14:13:54 | <tdammers> | well, I'm not familiar with nim, so I can't tell whether its type system is useful in the same way as Haskell's |
| 2020-09-24 14:14:31 | <shad0w_> | it has a type checker and infer-ness. but i don't think it's hinley milner or the likes |
| 2020-09-24 14:15:12 | <tdammers> | I mean, are the types expressive enough to add the kind of value that you can get out of Haskell's types |
| 2020-09-24 14:15:28 | <shad0w_> | no context on that lol |
| 2020-09-24 14:15:29 | <tdammers> | or is it more like int, bool, string, float, object, done? |
| 2020-09-24 14:15:31 | <shad0w_> | newbie in both |
| 2020-09-24 14:15:35 | <tdammers> | ah, fair enough |
| 2020-09-24 14:15:48 | × | thecoffemaker quits (~thecoffem@unaffiliated/thecoffemaker) (Ping timeout: 260 seconds) |
| 2020-09-24 14:16:00 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-24 14:16:57 | <shad0w_> | it has macros too |
| 2020-09-24 14:17:09 | <shad0w_> | so i think you can do a fair bit of untyped stuff as well |
| 2020-09-24 14:17:18 | <shad0w_> | just never got around to doing that lol |
| 2020-09-24 14:17:25 | <tdammers> | macros don't have to bypass the type system |
| 2020-09-24 14:17:37 | <shad0w_> | haskell on the other hand. will probably wont let you do untyped stuff |
| 2020-09-24 14:17:40 | <tdammers> | Haskell has an untyped macro language (Template Haskell), but its output is stilly typed |
| 2020-09-24 14:18:16 | → | thecoffemaker joins (~thecoffem@unaffiliated/thecoffemaker) |
| 2020-09-24 14:18:16 | <shad0w_> | does haskell's FFI also have to be typed ? |
| 2020-09-24 14:18:24 | <shad0w_> | like if i interface a C lib |
| 2020-09-24 14:18:31 | → | nerdypepper joins (nerdypeppe@152.67.160.69) |
| 2020-09-24 14:18:39 | <[exa]> | tdammers: you imply that average programmer brain has 25 lines? :D |
| 2020-09-24 14:18:55 | <tdammers> | [exa]: now that would be generous. it's really more like 7. |
| 2020-09-24 14:19:12 | <[exa]> | goooood |
| 2020-09-24 14:19:55 | <davve> | i struggle with 1 line sometimes |
| 2020-09-24 14:20:01 | → | geekosaur joins (42d52102@66.213.33.2) |
| 2020-09-24 14:20:04 | <tdammers> | shad0w_: then you are responsible for declaring appropriate types on the Haskell side. the compiler will slap you when the types are grossly incompatible, but things like whether a C procedure has side effects (and should thus be declared to return IO something on the Haskell side), that's up to you |
| 2020-09-24 14:20:05 | <davve> | (horrible metric) |
| 2020-09-24 14:20:09 | <[exa]> | shad0w_: for FFI you need to provide some information on basically how to convert haskell types to C and back; some C types are mapped to normal haskell ones. Otherwise it just works (TM) |
| 2020-09-24 14:20:20 | <[exa]> | davve: how wide is your editor tho? |
| 2020-09-24 14:20:28 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 260 seconds) |
| 2020-09-24 14:20:49 | <davve> | it automatically breaks at 120 I think |
| 2020-09-24 14:20:52 | <davve> | characters |
| 2020-09-24 14:21:04 | <shad0w_> | i see. |
| 2020-09-24 14:21:06 | <tdammers> | [exa]: if you have to ask what the maximum line length in vim is, then you're in trouble |
| 2020-09-24 14:21:59 | × | bitmapper quits (uid464869@gateway/web/irccloud.com/x-grfphxmgfozlnroq) (Quit: Connection closed for inactivity) |
| 2020-09-24 14:22:03 | × | eric_ quits (~eric@2804:431:c7d4:b4fa:51d1:5637:ed81:5491) () |
| 2020-09-24 14:22:47 | <shad0w_> | uhm. one more thing guys |
| 2020-09-24 14:22:49 | <[exa]> | let's measure code in tweets instead, that's a metric you can rely on |
| 2020-09-24 14:22:58 | <tdammers> | not at all |
| 2020-09-24 14:23:07 | <shad0w_> | there seem to be 2 laws for Functors |
| 2020-09-24 14:23:31 | <shad0w_> | and you can basically write code that typechecks but still violates the laws |
| 2020-09-24 14:23:33 | <[exa]> | tdammers: except for the SI-breaking 320character change ofc. |
| 2020-09-24 14:23:47 | <tdammers> | well, that, but also images, videos, etc |
| 2020-09-24 14:24:08 | <shad0w_> | so my Q is, whenever writing a Functor instance. do we also have to explicitly check that it's satisfying those 2 laws everytime ? |
| 2020-09-24 14:24:08 | <tdammers> | you can also encode a lot of information in diacritics |
| 2020-09-24 14:24:12 | → | W3BV1P3R joins (~W3BV1P3R@c-73-5-91-226.hsd1.tn.comcast.net) |
| 2020-09-24 14:24:36 | <[exa]> | shad0w_: the laws are "standardized" so that you know what to expect from other people's functors. If you work with unlawful functors, stuff is likely to not work in unexpected weird ways |
| 2020-09-24 14:24:42 | × | W3BV1P3R quits (~W3BV1P3R@c-73-5-91-226.hsd1.tn.comcast.net) (Client Quit) |
| 2020-09-24 14:25:03 | <[exa]> | shad0w_: the usual problem with that is that the laws cannot be easily typechecked though |
| 2020-09-24 14:25:29 | <tdammers> | shad0w_: we don't *have* to; the compiler won't check your code for lawfulness, that's why they're laws, rather than typeclass methods. but it's very much recommended to obey those laws, because if your functor doesn't, then unexpected things can happen, such as things not being equal that should be |
| 2020-09-24 14:25:31 | <geekosaur> | there are languages where you must provide proofs of the laws; haskell is not one of them, because it's not powerful enough to test many of them |
| 2020-09-24 14:25:42 | → | oisdk joins (~oisdk@2001:bb6:3329:d100:fd58:7633:8b1d:97) |
| 2020-09-24 14:25:47 | × | ryansmccoy quits (~ryansmcco@193.37.254.27) (Ping timeout: 240 seconds) |
| 2020-09-24 14:26:12 | <shad0w_> | [exa]: if i work with unlawful functors, stuff is likely to not work in unexpected weird ways? should'nt it be the opposite. like they will kindda glitch ? |
| 2020-09-24 14:26:20 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-09-24 14:26:36 | → | ryansmccoy joins (~ryansmcco@193.37.254.27) |
| 2020-09-24 14:26:37 | × | snakemasterflex quits (~snakemast@213.100.206.23) (Ping timeout: 264 seconds) |
| 2020-09-24 14:27:08 | <geekosaur> | huh? it's on you to provide lawful functors, other things will assume lawfulness and may break if yours isn't |
| 2020-09-24 14:27:52 | <tdammers> | it probably helps to look at some concrete unlawful functors |
| 2020-09-24 14:27:55 | → | snakemasterflex joins (~snakemast@213.100.206.23) |
| 2020-09-24 14:27:56 | <shad0w_> | geekosaur: i see. so ensure lawfulness if you can everytime ? got it. |
| 2020-09-24 14:28:13 | <tdammers> | ensure lawfulness; if you can't, don't write that functor instance |
| 2020-09-24 14:28:13 | <geekosaur> | yes. |
| 2020-09-24 14:28:15 | <shad0w_> | tdammers: i did. does weird stuff that will glitch at runtime |
| 2020-09-24 14:28:59 | <shad0w_> | gotch'a guys. thanks much. |
| 2020-09-24 14:29:27 | → | bitmapper joins (uid464869@gateway/web/irccloud.com/x-fwqmglpbkrhstmiw) |
| 2020-09-24 14:29:28 | <tdammers> | once you have a good intuition for the functor concept, judging the lawfulness of a functor instance becomes a lot easier |
| 2020-09-24 14:29:50 | <Cale> | All you have to check in Haskell is that fmap id = id |
| 2020-09-24 14:30:01 | <Cale> | Everything else gets enforced by parametricity |
| 2020-09-24 14:30:18 | × | DataComputist quits (~lumeng@static-50-43-26-251.bvtn.or.frontiernet.net) (Quit: Leaving...) |
| 2020-09-24 14:30:25 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 240 seconds) |
| 2020-09-24 14:30:48 | <shad0w_> | Cale: so if the id works. the second one (function composition) should also work ? |
| 2020-09-24 14:30:54 | × | Sanchayan quits (~Sanchayan@171.76.101.244) (Quit: leaving) |
| 2020-09-24 14:31:31 | <phadej> | gadts... |
| 2020-09-24 14:31:49 | → | polyphem joins (~p0lyph3m@2a02:810d:640:776c:76d7:55f6:f85b:c889) |
| 2020-09-24 14:32:34 | × | jedws quits (~jedws@2001:8003:337f:1b00:4ccc:a9c7:5cc7:b953) (Quit: My MacBook has gone to sleep. ZZZzzz…) |
| 2020-09-24 14:32:58 | <phadej> | deriving (Functor) is the simplest |
| 2020-09-24 14:33:01 | <Orbstheorem> | Hello o/ I'm trying to write an lhs file in markdown, but GHC seems to try to interpret section headings somehow :/ |
| 2020-09-24 14:33:24 | <Orbstheorem> | (i.g. `r"^#+.*"`) |
| 2020-09-24 14:34:02 | <phadej> | lhs files are latex by default |
| 2020-09-24 14:34:34 | × | Dolly quits (585fd1fd@ti0203q160-5312.bb.online.no) (Remote host closed the connection) |
| 2020-09-24 14:35:15 | <geekosaur> | or "bird tracks" (lines starting with "> " are documentation) |
| 2020-09-24 14:35:25 | <Orbstheorem> | I wrote my file using bird tracks. |
| 2020-09-24 14:35:32 | <Orbstheorem> | Oh: https://gitlab.haskell.org/ghc/ghc/-/wikis/literate-markdown |
| 2020-09-24 14:35:45 | <phadej> | geekosaur: other way around |
| 2020-09-24 14:35:53 | <phadej> | bird tracks are code |
| 2020-09-24 14:36:03 | → | machinedgod joins (~machinedg@45.78.189.122) |
| 2020-09-24 14:37:38 | <Cale> | shad0w_: yes |
| 2020-09-24 14:37:59 | <Cale> | @free (a -> b) -> f a -> f b |
| 2020-09-24 14:38:00 | <lambdabot> | Try `free <ident>` or `free <ident> :: <type>` |
| 2020-09-24 14:38:25 | <Cale> | @free putativeFmap :: (a -> b) -> f a -> f b |
| 2020-09-24 14:38:25 | <lambdabot> | Extra stuff at end of line |
| 2020-09-24 14:38:40 | <Cale> | hmm, I forget how to use this thing, lol |
| 2020-09-24 14:38:43 | <Cale> | @free fmap |
| 2020-09-24 14:38:45 | <lambdabot> | Extra stuff at end of line in retrieved type "Functor f => (a -> b) -> f a -> f b" |
| 2020-09-24 14:38:49 | <Cale> | weird |
| 2020-09-24 14:40:35 | <sm[m]> | "haskell's not relatively unpopular because it was late to add things like linear types. It's relatively unpopular because it doesn't care much about user experience. Consider: it's getting linear types before an efficient string type in `base`." |
| 2020-09-24 14:41:10 | <maerwald> | true |
| 2020-09-24 14:41:12 | → | oish joins (~charlie@228.25.169.217.in-addr.arpa) |
| 2020-09-24 14:41:16 | <dolio> | I think you might need quantifiers. |
All times are in UTC.