Newest at the top
2025-04-16 16:00:16 +0200 | Digitteknohippie | (~user@user/digit) Digit |
2025-04-16 15:59:13 +0200 | acidjnk | (~acidjnk@p200300d6e71c4f4138f4856942b014fc.dip0.t-ipconnect.de) acidjnk |
2025-04-16 15:57:31 +0200 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) (Ping timeout: 276 seconds) |
2025-04-16 15:56:33 +0200 | <ski> | that's implied, implicit, due to them being methods of `Monad m', here |
2025-04-16 15:56:18 +0200 | <ski> | note that this does not mention any `Monad => ' in the type signatures of the methods here |
2025-04-16 15:56:10 +0200 | <lambdabot> | fail :: String -> m a |
2025-04-16 15:56:08 +0200 | <lambdabot> | return :: a -> m a |
2025-04-16 15:56:06 +0200 | <lambdabot> | (>>) :: m a -> m b -> m b |
2025-04-16 15:56:06 +0200 | <lambdabot> | (>>=) :: m a -> (a -> m b) -> m b |
2025-04-16 15:56:06 +0200 | <lambdabot> | -- Note: Applicative wasn't a superclass before GHC 7.10 |
2025-04-16 15:56:06 +0200 | <lambdabot> | class Applicative m => Monad m where |
2025-04-16 15:56:05 +0200 | <ski> | @src Monad |
2025-04-16 15:55:48 +0200 | <ski> | ah, imho you should also remove the remaining `Monad m => ' |
2025-04-16 15:55:43 +0200 | JuanDaugherty | (~juan@user/JuanDaugherty) JuanDaugherty |
2025-04-16 15:55:11 +0200 | <ski> | (you also changed one `b' to `l', for unclear reasons) |
2025-04-16 15:54:47 +0200 | <ski> | (and then there's the issue with `s0' and `s1' in the signature for `(<*>)') |
2025-04-16 15:54:23 +0200 | <bwe> | ok, let me try to get it right :). |
2025-04-16 15:53:49 +0200 | <ski> | after `::', you're writing types. `MkState' is not a type, it does not belong there |
2025-04-16 15:53:20 +0200 | <ski> | i still would like you to remove all mentions of `MkState ' from the type signatures |
2025-04-16 15:52:49 +0200 | <ski> | this last definition of `(>>=)' is fine |
2025-04-16 15:52:47 +0200 | amadaluzia_ | (~amadaluzi@user/amadaluzia) (Ping timeout: 265 seconds) |
2025-04-16 15:52:46 +0200 | merijn | (~merijn@host-vr.cgnat-g.v4.dfn.nl) merijn |
2025-04-16 15:52:42 +0200 | <ski> | yes |
2025-04-16 15:52:31 +0200 | <bwe> | Instance Type Signatures were a good idea btw. |
2025-04-16 15:52:01 +0200 | <ski> | (good that you added brackets around `<*>', in the type signatures. was wondering whether i had to point that out) |
2025-04-16 15:51:17 +0200 | <ski> | -- fmap :: (a -> b) -> State (s -> (a, s)) -> State (s -> (b, s)) |
2025-04-16 15:51:16 +0200 | <ski> | is not any better than |
2025-04-16 15:51:12 +0200 | <ski> | -- fmap :: (a -> b) -> MkState (s0 -> (a, s1)) -> MkState (s0 -> (l, s1)) |
2025-04-16 15:50:57 +0200 | amadaluzia | (~amadaluzi@user/amadaluzia) (Ping timeout: 244 seconds) |
2025-04-16 15:50:25 +0200 | <ski> | the definition of `(>>=)' is still not right |
2025-04-16 15:49:50 +0200 | <bwe> | ski: how are the type signatures now? |
2025-04-16 15:49:35 +0200 | <bwe> | [exa]: >>= is now defined, incorporating s1 |
2025-04-16 15:48:57 +0200 | <ski> | MkState :: (s -> (a,s)) -> State s a |
2025-04-16 15:48:45 +0200 | <ski> | which you can abbreviate as |
2025-04-16 15:48:32 +0200 | <ski> | in symbols, if `x :: s -> (a,s)', then `MkState x :: State s a' |
2025-04-16 15:48:06 +0200 | <ski> | what this (BNF-inspired) notation *actually* means, is that if `x' has type `s -> (a,s)', then `MkState x' has type `State s a' |
2025-04-16 15:47:20 +0200 | dutchie | (~dutchie@user/dutchie) dutchie |
2025-04-16 15:47:19 +0200 | <ski> | this notation does not mean that the type `State s a' is equal to the "type" `MkState (s -> (a, s))' (this is not a type) |
2025-04-16 15:47:02 +0200 | dutchie | (~dutchie@user/dutchie) (Remote host closed the connection) |
2025-04-16 15:46:42 +0200 | <ski> | here is what's confusing |
2025-04-16 15:46:34 +0200 | <ski> | newtype State s a = MkState (s -> (a, s)) |
2025-04-16 15:46:33 +0200 | <ski> | presumably the notation |
2025-04-16 15:46:15 +0200 | <ski> | `MkState' is value-level (a data constructor), it's not type-level. so it makes no sense to mention it in the type signature |
2025-04-16 15:45:36 +0200 | <ski> | this makes no sense |
2025-04-16 15:45:32 +0200 | <ski> | -- (>>=) :: Monad m => MkState (s -> (a, s)) -> (a -> MkState (s -> (b, s))) -> MkState (s -> (b, s)) |
2025-04-16 15:45:29 +0200 | <ski> | ah, you updated it |
2025-04-16 15:44:49 +0200 | <ski> | the definition of `(>>=)' isn't quite correct, but i guess you knew that |
2025-04-16 15:42:07 +0200 | euleritian | (~euleritia@dynamic-176-002-178-231.176.2.pool.telefonica.de) |
2025-04-16 15:41:56 +0200 | <ski> | `fmap :: (a -> b) -> (s -> (a,s)) -> (s -> (b,s))' also, strictly speaking, isn't correct. but it's the type signature you'd get, if you were able to use `type State s a = (s -> (a,s))' |
2025-04-16 15:41:55 +0200 | euleritian | (~euleritia@ip5f5ad695.dynamic.kabel-deutschland.de) (Ping timeout: 276 seconds) |