Home freenode/#haskell: Logs Calendar

Logs: freenode/#haskell

←Prev  Next→
Page 1 .. 665 666 667 668 669 670 671 672 673 674 675 .. 5022
502,152 events total
2020-10-16 04:06:26 <hololeap> just something pseudo-haskelly to illustrate the point
2020-10-16 04:06:34 <larou> i think basically he managed to get quite a lot of expression from just category and arrow
2020-10-16 04:06:47 <larou> like, enough to write a compiler of sorts, with this idea of a stack
2020-10-16 04:06:59 <larou> erm, ok, i guess something like;
2020-10-16 04:07:34 <larou> update 1 (+1) (1,(2,3)) = (1,(3,3))
2020-10-16 04:07:37 <larou> ===
2020-10-16 04:07:47 <larou> update 1 (+1) [1,2,3] = [1,3,3]
2020-10-16 04:08:25 × elliott__ quits (~elliott@pool-108-51-141-12.washdc.fios.verizon.net) (Ping timeout: 240 seconds)
2020-10-16 04:08:50 <larou> not that that shows anything about the compiler stack idea
2020-10-16 04:09:17 <larou> the talk was here; https://www.youtube.com/watch?v=wvQbpS6wBa0
2020-10-16 04:09:20 jedws joins (~jedws@121.209.161.98)
2020-10-16 04:09:40 Reiser2 is now known as Reiser
2020-10-16 04:09:44 × Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-225-82.dhcp-dynamic.fibreop.nb.bellaliant.net) (Remote host closed the connection)
2020-10-16 04:09:47 × Reiser quits (~0a2a0001@static.210.242.216.95.clients.your-server.de) (Changing host)
2020-10-16 04:09:47 Reiser joins (~0a2a0001@unaffiliated/reisen)
2020-10-16 04:10:03 Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-225-82.dhcp-dynamic.fibreop.nb.bellaliant.net)
2020-10-16 04:10:31 <hololeap> i know i asked for pseudo-haskell, but what would the type be for `update` in the first example?
2020-10-16 04:10:48 <hololeap> i don't understand what the first 1 is for
2020-10-16 04:11:02 <larou> well in the list example its the index
2020-10-16 04:11:13 <larou> > [1,2,3] !! 1
2020-10-16 04:11:16 <lambdabot> 2
2020-10-16 04:11:25 <hololeap> oh
2020-10-16 04:11:47 <larou> the type signature totally fails for the first example because really, nested pairs are not lists...
2020-10-16 04:13:25 <larou> i think in the talk he was flipping the order of the pair around
2020-10-16 04:13:28 <hololeap> update 0 = _1 ; update n f = _2 . update (n-1) f
2020-10-16 04:13:31 <larou> so that the tail was on the first
2020-10-16 04:13:43 <hololeap> (that might not be correct, i didn't test it)
2020-10-16 04:14:00 ensyde joins (~ensyde@2600:1702:2e30:1a40:48f9:cdc3:db29:25b7)
2020-10-16 04:15:15 <larou> i dont think you should be dotting? like the update (n-1) is the function passed to _2 right?
2020-10-16 04:15:20 <larou> % :t _2
2020-10-16 04:15:20 <yahb> larou: (Field2 s t a b, Functor f) => (a -> f b) -> s -> f t
2020-10-16 04:15:36 <hololeap> :% t (_2 . _2 . _2 . _1)
2020-10-16 04:15:51 <hololeap> broke it
2020-10-16 04:15:52 <larou> % t (_2 . _2 . _2 . _1)
2020-10-16 04:15:52 <yahb> larou: ; <interactive>:41:1: error: Variable not in scope: t :: ((a3 -> f0 b3) -> s0 -> f0 t0) -> t
2020-10-16 04:16:05 <hololeap> % :t (_2 . _2 . _2 . _1)
2020-10-16 04:16:06 <yahb> hololeap: (Functor f, Field2 s t a1 b1, Field2 a1 b1 a2 b2, Field2 a2 b2 a3 b3, Field1 a3 b3 a4 b4) => (a4 -> f b4) -> s -> f t
2020-10-16 04:16:49 <larou> % :t \f -> (_2 (_1 f))
2020-10-16 04:16:50 <yahb> larou: (Field2 s1 t s2 b1, Functor f, Field1 s2 b1 a b2) => (a -> f b2) -> s1 -> f t
2020-10-16 04:17:53 <larou> % :t (\f -> (_2 (_1 f))) (+1) (1,(2,3))
2020-10-16 04:17:53 <yahb> larou: (Functor f, Num a, Num b1, Num (f b2)) => f (a, (b2, b1))
2020-10-16 04:17:57 <hololeap> % :t \n f = let foo n = case n of ; 0 -> _1 ; n' -> _2 . foo (n-1)
2020-10-16 04:17:57 <yahb> hololeap: ; <interactive>:1:6: error: parse error on input `='
2020-10-16 04:17:57 <larou> % (\f -> (_2 (_1 f))) (+1) (1,(2,3))
2020-10-16 04:17:58 <yahb> larou: ; <interactive>:46:1: error:; * Ambiguous type variables `f0', `b0' arising from a use of `print'; prevents the constraint `(Show (f0 (Integer, (b0, Integer))))' from being solved.; Probable fix: use a type annotation to specify what `f0', `b0' should be.; These potential instances exist:; instance Show a => Show (ZipList a) -- Defined in `Control.Applicative'; insta
2020-10-16 04:18:08 <larou> !
2020-10-16 04:18:09 <hololeap> % :t \n = let foo n = case n of ; 0 -> _1 ; n' -> _2 . foo (n-1)
2020-10-16 04:18:09 <yahb> hololeap: ; <interactive>:1:4: error: parse error on input `='
2020-10-16 04:18:39 × Kaiepi quits (~Kaiepi@nwcsnbsc03w-47-55-225-82.dhcp-dynamic.fibreop.nb.bellaliant.net) (Remote host closed the connection)
2020-10-16 04:18:42 × ensyde quits (~ensyde@2600:1702:2e30:1a40:48f9:cdc3:db29:25b7) (Ping timeout: 260 seconds)
2020-10-16 04:18:54 Kaiepi joins (~Kaiepi@nwcsnbsc03w-47-55-225-82.dhcp-dynamic.fibreop.nb.bellaliant.net)
2020-10-16 04:18:59 <larou> % :t \n -> let foo n = case n of ; 0 -> _1 ; n' -> _2 . foo (n-1)
2020-10-16 04:18:59 <yahb> larou: ; <interactive>:1:61: error: parse error (possibly incorrect indentation or mismatched brackets)
2020-10-16 04:19:31 <larou> % :t \n -> let foo n = case n of ; 0 -> _1 ; n' -> _2 . foo (n-1) in foo 1 (+1) (1,(2,3))
2020-10-16 04:19:31 <yahb> larou: ; <interactive>:1:65: error:; * Occurs check: cannot construct the infinite type: b1 ~ (f b, b1); arising from a functional dependency between:; constraint `Field2 (f b, (f b, b1)) (b, (f b, b1)) (f b, (f b, b1)) (b, (f b, b1))' arising from a use of `foo'; instance Field2 (a, b2) (a, b') b2 b' at <no location info>; * In the expression: foo 1 (+ 1) (1, (2, 3));
2020-10-16 04:19:45 <larou> this isnt working at all!
2020-10-16 04:20:11 <larou> crazy lenses...
2020-10-16 04:20:33 <hololeap> % update 0 = _1 ; update n = _2 . update (n-1)
2020-10-16 04:20:33 <yahb> hololeap:
2020-10-16 04:20:36 <hololeap> % :t update
2020-10-16 04:20:37 <yahb> hololeap: (Eq t, Num t, Field1 a1 b1 a2 b2, Functor f, Field2 a1 b1 a1 b1) => t -> (a2 -> f b2) -> a1 -> f b1
2020-10-16 04:20:48 <hololeap> anyway, that's what i was going for
2020-10-16 04:21:09 <larou> how is that used?
2020-10-16 04:21:22 plast1k_ joins (~plast1k_@196.207.181.246)
2020-10-16 04:24:36 <larou> % update 1 return (1,(2,3))
2020-10-16 04:24:37 <yahb> larou: ; <interactive>:52:1: error:; * Occurs check: cannot construct the infinite type: b ~ (a, b); arising from a functional dependency between:; constraint `Field2 (a, (a, b)) (a, (a, b)) (a, (a, b)) (a, (a, b))' arising from a use of `update'; instance Field2 (a1, b1) (a1, b') b1 b' at <no location info>; * In the expression: update 1 return (1, (2, 3)); In an equat
2020-10-16 04:24:59 <larou> how does that even typecheck!?
2020-10-16 04:25:03 × nbloomf quits (~nbloomf@2600:1700:83e0:1f40:21a4:edc3:68a:18f4) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-10-16 04:27:17 <larou> i think you would have to make update a function of a class so it could match on the type it was being applied to
2020-10-16 04:29:47 × da39a3ee5e6b4b0d quits (~textual@n11211935170.netvigator.com) (Quit: My MacBook has gone to sleep. ZZZzzz…)
2020-10-16 04:30:31 <hololeap> yeah this doesn't typecheck well when applied to an actual value
2020-10-16 04:30:45 × fraktor quits (~walt@129.93.191.18) (Quit: WeeChat 2.8)
2020-10-16 04:31:58 × Guest34869 quits (~chris@81.96.113.213) (Remote host closed the connection)
2020-10-16 04:32:00 <hololeap> there was a library that could convert (1,2,3,4) to [1,2,3,4] somehow
2020-10-16 04:32:00 × XorSwap quits (~user@wnpgmb016qw-ds01-98-128.dynamic.bellmts.net) (Quit: XorSwap)
2020-10-16 04:33:25 <larou> you mean (1,(2,(3,4))) ?
2020-10-16 04:33:54 × Tario quits (~Tario@201.192.165.173) (Read error: Connection reset by peer)
2020-10-16 04:34:10 Tario joins (~Tario@201.192.165.173)
2020-10-16 04:34:38 <hololeap> i remember it being (1,2,3,4) -> [1,2,3,4]. you would have to convert (1,(2,(3,4))) to (1,2,3,4) first i suppose
2020-10-16 04:34:52 <larou> well thats no good!
2020-10-16 04:34:58 <hololeap> anyway, possible, but tricky with haskell's type system
2020-10-16 04:35:04 × sdx23 quits (~sdx23@unaffiliated/sdx23) (Ping timeout: 265 seconds)
2020-10-16 04:35:10 <larou> anyway, whats the point in having something that typechecks except when its applied to a value
2020-10-16 04:35:37 <hololeap> there isn't one. i made a mistake
2020-10-16 04:35:52 <larou> k
2020-10-16 04:35:52 conal joins (~conal@64.71.133.70)
2020-10-16 04:35:58 hackage sweet-egison 0.1.1.1 - Shallow embedding implementation of non-linear pattern matching https://hackage.haskell.org/package/sweet-egison-0.1.1.1 (SatoshiEgi)
2020-10-16 04:36:00 <larou> btw did anyone see this>
2020-10-16 04:36:01 <larou> https://pastebin.com/raw/J0e4fa3d
2020-10-16 04:36:02 <larou> ?
2020-10-16 04:36:04 <hololeap> although it should be possible
2020-10-16 04:36:11 <hololeap> using type families or something
2020-10-16 04:36:15 <larou> i was trying to write cons for a cyclic list
2020-10-16 04:36:30 <larou> but got stuck
2020-10-16 04:38:01 × geowiesnot quits (~user@87-89-181-157.abo.bbox.fr) (Ping timeout: 264 seconds)
2020-10-16 04:38:19 merijn joins (~merijn@83-160-49-249.ip.xs4all.nl)
2020-10-16 04:38:32 × Tario quits (~Tario@201.192.165.173) (Ping timeout: 258 seconds)
2020-10-16 04:38:43 × ech quits (~user@gateway/tor-sasl/ech) (Ping timeout: 240 seconds)
2020-10-16 04:38:58 da39a3ee5e6b4b0d joins (~textual@n11211935170.netvigator.com)
2020-10-16 04:41:14 × conal quits (~conal@64.71.133.70) (Quit: Computer has gone to sleep.)

All times are in UTC.