Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 617 618 619 620 621 622 623 624 625 626 627 .. 5022
502,152 events total
2020-10-13 16:18:34 <ski> jil : in any case, the normal way to specify the types of function arguments is to provide a type signature for the whole function (normally before the function definition), like `add :: Int -> Int -> Int -> Int' (also specifying the result type)
2020-10-13 16:18:48 <jil> also when I :load a script with `add (x :: Int) (y :: Int) (z :: Int) = x + y + z :: Int` directly from ghci I get an error. https://paste.debian.net/1166990/ illegal type signature 'Int'
2020-10-13 16:19:38 <geekosaur> because it's trying to do a pattern signature which is an extension (it should have said something about ScopedTypeVariables)
2020-10-13 16:19:39 <jil> why is that ?
2020-10-13 16:19:46 <blip> kuribas: but also quite dangerous, you can easily construct an incomplete record
2020-10-13 16:19:47 <ski> jil : yes. as i mentioned (in brief) above, using that style (having `:: Int' in the formal parameters / patterns) is a language extension. try placing the following line as the first line in your script :
2020-10-13 16:19:48 <jil> yes it does.
2020-10-13 16:19:56 <ski> {-# LANGUAGE ScopedTypeVariables #-}
2020-10-13 16:19:59 <geekosaur> ski just told you the correct way to specify a function signature
2020-10-13 16:20:10 <jil> ok.
2020-10-13 16:20:13 <kuribas> blip: wouldn't that generate a warning?
2020-10-13 16:20:36 <ski> (if you want to play around with this style of ascribing types also to patterns, not just to expressions, that is)
2020-10-13 16:20:40 <blip> kuribas: I think yes with -Wall
2020-10-13 16:21:20 <kuribas> blip: I can turn a warning in an error, can't I?
2020-10-13 16:21:20 × nados quits (~dan@107-190-41-58.cpe.teksavvy.com) (Read error: Connection reset by peer)
2020-10-13 16:21:34 <blip> kuribas: yes, -Werr
2020-10-13 16:21:47 nados joins (~dan@107-190-41-58.cpe.teksavvy.com)
2020-10-13 16:22:15 <kuribas> ah -Werror=⟨wflag⟩
2020-10-13 16:22:27 <blip> yep
2020-10-13 16:22:30 <jil> ski geekosaur ok. I had not understood what you meant by `a language extension`. It's clear know and my script works.
2020-10-13 16:22:53 <kuribas> strange haskell is so loose with undefined fields
2020-10-13 16:23:00 × Sgeo quits (~Sgeo@ool-18b982ad.dyn.optonline.net) (Read error: Connection reset by peer)
2020-10-13 16:23:02 <kuribas> IMO it should be an error
2020-10-13 16:23:24 fendor_ joins (~fendor@t204-126.demo.tuwien.ac.at)
2020-10-13 16:23:24 <ski> ditto for missing methods ?
2020-10-13 16:23:29 <blip> there is a lot of undefined
2020-10-13 16:23:35 <blip> what about head?
2020-10-13 16:23:39 <kuribas> ski: that's an error right?
2020-10-13 16:23:41 nyd joins (~lpy@unaffiliated/elysian)
2020-10-13 16:23:46 <dolio> No.
2020-10-13 16:23:52 <ski> @let data Foo = MkFoo; instance Num Foo
2020-10-13 16:23:54 <lambdabot> .L.hs:160:10: error: [-Wmissing-methods, -Werror=missing-methods]
2020-10-13 16:23:54 <lambdabot> • No explicit implementation for
2020-10-13 16:23:54 <lambdabot> ‘+’, ‘*’, ‘abs’, ‘signum’, ‘fromInteger’, and (either ‘negate’
2020-10-13 16:24:06 <blip> :)
2020-10-13 16:24:07 <monochrom> missing methods and undefined values are dynamic errors, not static errors.
2020-10-13 16:24:16 <ski> lambdabot doesn't like it, since it has `-Werror=missing-methods'
2020-10-13 16:24:17 <kuribas> ah you mean missing instance methods...
2020-10-13 16:24:29 <kuribas> indeed, that should be an error IMO
2020-10-13 16:24:50 <blip> > head []
2020-10-13 16:24:52 <lambdabot> *Exception: Prelude.head: empty list
2020-10-13 16:25:48 Reiser2 joins (~0a2a0001@static.210.242.216.95.clients.your-server.de)
2020-10-13 16:25:52 <blip> we need `-Werror=undefined`
2020-10-13 16:25:57 <ski> jil : you understand how to "line up" the arguments in `add x y z = x + y + z' with the types in `add :: Int -> Int -> Int -> Int' (or even `add :: Num a => a -> a -> a -> a'), yes ?
2020-10-13 16:26:01 × dustinm- quits (~dustinm@static.38.6.217.95.clients.your-server.de) (Ping timeout: 264 seconds)
2020-10-13 16:26:23 × fendor quits (~fendor@e237-037.eduroam.tuwien.ac.at) (Ping timeout: 258 seconds)
2020-10-13 16:26:43 <kuribas> I find partial functions are always a mistake, because you don't get a good error message.
2020-10-13 16:26:49 × Reiser quits (~0a2a0001@unaffiliated/reisen) (Ping timeout: 246 seconds)
2020-10-13 16:26:55 lowryder joins (~djlowry@web603.webfaction.com)
2020-10-13 16:26:59 <blip> like (/)
2020-10-13 16:27:25 × chrpape quits (~user@2a01:4f9:c010:632d::1) (Ping timeout: 240 seconds)
2020-10-13 16:27:28 <blip> :: Rational
2020-10-13 16:27:53 noteness_ joins (noteness@unaffiliated/nessessary129)
2020-10-13 16:27:59 jhuizy3 joins (~jhuizy@static.241.188.216.95.clients.your-server.de)
2020-10-13 16:28:02 × fl0_id quits (~fl0_id@2a01:4f8:171:4de::40:2) (Quit: ZNC)
2020-10-13 16:28:02 <kuribas> yeah
2020-10-13 16:28:03 × Unhammer quits (~Unhammer@gateway/tor-sasl/unhammer) (Ping timeout: 240 seconds)
2020-10-13 16:28:07 × M2tias quits (m2@seri.fi) (Ping timeout: 240 seconds)
2020-10-13 16:28:19 uwap_ joins (~uwap@genja.uwap.name)
2020-10-13 16:28:33 × kuribas quits (~user@ip-188-118-57-242.reverse.destiny.be) (Remote host closed the connection)
2020-10-13 16:28:34 fl0_id joins (~fl0_id@claudia.s7t.de)
2020-10-13 16:29:06 <monochrom> Perhaps you can accept a compromise? Partial functions/values with the HasCallStack constraint are not static errors; without, are static errors.
2020-10-13 16:29:12 × uwap quits (~uwap@genja.uwap.name) (Read error: Connection reset by peer)
2020-10-13 16:29:21 M2tias joins (m2@seri.fi)
2020-10-13 16:29:47 × jhuizy quits (~jhuizy@static.241.188.216.95.clients.your-server.de) (Ping timeout: 260 seconds)
2020-10-13 16:29:47 jhuizy3 is now known as jhuizy
2020-10-13 16:29:55 Lycurgus joins (~niemand@98.4.96.235)
2020-10-13 16:30:06 <blip> I have to go, the abyss of promoted constructors is calling my name
2020-10-13 16:30:29 <dolio> I write good errors in my partial functions. :)
2020-10-13 16:30:35 × noteness quits (~noteness@unaffiliated/nessessary129) (Ping timeout: 244 seconds)
2020-10-13 16:30:57 dustinm joins (~dustinm@static.38.6.217.95.clients.your-server.de)
2020-10-13 16:32:00 cole-h joins (~cole-h@c-73-48-197-220.hsd1.ca.comcast.net)
2020-10-13 16:32:05 Unhammer joins (~Unhammer@gateway/tor-sasl/unhammer)
2020-10-13 16:34:20 howdoi joins (uid224@gateway/web/irccloud.com/x-llljiaghhgnypdze)
2020-10-13 16:35:09 × blip quits (58823d9e@gateway/web/cgi-irc/kiwiirc.com/ip.88.130.61.158) (Quit: Connection closed)
2020-10-13 16:35:27 hackage prolens 0.0.0.0 - Profunctor-based lightweight implementation of optics https://hackage.haskell.org/package/prolens-0.0.0.0 (shersh)
2020-10-13 16:40:43 Sgeo joins (~Sgeo@ool-18b982ad.dyn.optonline.net)
2020-10-13 16:41:22 × uwap_ quits (~uwap@genja.uwap.name) (Remote host closed the connection)
2020-10-13 16:41:34 uwap joins (~uwap@genja.uwap.name)
2020-10-13 16:42:05 × pgib quits (~textual@lmms/pgib) (Ping timeout: 240 seconds)
2020-10-13 16:43:51 <maerwald> A language with no partial functions seems like a pain in the *ss. You don't really care about partial functions, you care about your program being total.
2020-10-13 16:45:28 ski . o O ( preconditions & postconditions )
2020-10-13 16:46:14 <monochrom> inb4 Sapir-Whorf
2020-10-13 16:46:16 × snakemas1 quits (~snakemast@213.100.206.23) (Ping timeout: 256 seconds)
2020-10-13 16:47:09 × nineonin_ quits (~nineonine@216-19-190-182.dyn.novuscom.net) (Remote host closed the connection)
2020-10-13 16:49:56 × jollygood2 quits (~bc8165ab@217.29.117.252) (Quit: http://www.okay.uz/ (Session timeout))
2020-10-13 16:51:17 tzh joins (~tzh@2601:448:c500:5300::d90)
2020-10-13 16:53:58 × fendor_ quits (~fendor@t204-126.demo.tuwien.ac.at) (Remote host closed the connection)
2020-10-13 16:54:45 × taurux quits (~taurux@net-109-115-33-170.cust.vodafonedsl.it) (Ping timeout: 240 seconds)
2020-10-13 16:55:18 taurux joins (~taurux@net-109-115-33-211.cust.vodafonedsl.it)
2020-10-13 16:56:34 <Cheery> bucklescript translates the partial functions away.
2020-10-13 16:57:48 <Cheery> I'm curious about that because it means that on partial parameters they're constructing a closure that fills in the partial.
2020-10-13 16:58:53 <Cheery> also if you have function like a → b, if the 'b' turns out to be a function, then the parameters cannot be fused anyway.
2020-10-13 16:59:42 × heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Remote host closed the connection)
2020-10-13 16:59:54 × xerox_ quits (~xerox@unaffiliated/xerox) (Ping timeout: 272 seconds)
2020-10-13 17:00:45 <Cheery> nobody cares as long as they're not exposed in a library interface. That'd be interesting subject on its own.
2020-10-13 17:00:58 × Bakun quits (~bakun@51.15.0.88) (Ping timeout: 260 seconds)
2020-10-13 17:01:00 bahamas joins (~lucian@unaffiliated/bahamas)
2020-10-13 17:01:26 nineonine joins (~nineonine@216.81.48.202)
2020-10-13 17:01:51 × nineonine quits (~nineonine@216.81.48.202) (Remote host closed the connection)

All times are in UTC.