Logs: liberachat/#haskell
| 2026-04-13 17:16:09 | → | Xe joins (~Xe@perl/impostor/xe) |
| 2026-04-13 17:18:33 | × | jmcantrell_ quits (~weechat@user/jmcantrell) (Ping timeout: 248 seconds) |
| 2026-04-13 17:37:03 | → | shapr joins (~user@130.44.148.32) |
| 2026-04-13 17:37:32 | <shapr> | Huh, channel got smaller. |
| 2026-04-13 17:37:49 | <shapr> | maybe it's just the right size now? |
| 2026-04-13 17:37:59 | <shapr> | Oh hey, can I run Haskell on my keyboard? |
| 2026-04-13 17:42:42 | × | gmg quits (~user@user/gehmehgeh) (Quit: Leaving) |
| 2026-04-13 17:42:59 | → | gmg joins (~user@user/gehmehgeh) |
| 2026-04-13 17:43:04 | <shapr> | How much OS do I need to run MicroHS? 🤔 |
| 2026-04-13 17:45:30 | → | jmcantrell_ joins (~weechat@user/jmcantrell) |
| 2026-04-13 17:45:44 | <janus> | i think the target shouldn't need much OS since you can easily remove POSIX ffi calls and such |
| 2026-04-13 17:46:00 | <janus> | not sure whether you refer to host or target |
| 2026-04-13 17:46:16 | <shapr> | It's a silly idea anyway. |
| 2026-04-13 17:46:19 | <shapr> | Hello janus! |
| 2026-04-13 17:46:25 | ChanServ | sets mode +o janus |
| 2026-04-13 17:46:29 | <janus> | hi shapr |
| 2026-04-13 17:46:31 | <shapr> | you have THE POWER! |
| 2026-04-13 17:46:40 | <janus> | oh my |
| 2026-04-13 17:46:43 | <Rembane> | shapr: Please run Haskell on your keyboard! |
| 2026-04-13 17:46:48 | <Rembane> | Hi! :D |
| 2026-04-13 17:46:55 | ChanServ | sets mode +o Rembane |
| 2026-04-13 17:46:58 | <shapr> | hello Rembane! |
| 2026-04-13 17:47:15 | <shapr> | Rembane: I don't think I have a keyboard powerful enough to run Haskell. |
| 2026-04-13 17:47:28 | <Rembane> | shapr: Oh no! :( |
| 2026-04-13 17:47:42 | <shapr> | I don't think I have a keyboard powerful enough to run Rust unless it's no_std rust. |
| 2026-04-13 17:47:53 | <shapr> | Rembane: do you know of a keyboard powerful enough to run MicroHS? |
| 2026-04-13 17:48:19 | <janus> | shapr: have you seen Dmitry Grinberg write a MIPS emulator for the Intel 4004 from 1971 |
| 2026-04-13 17:48:30 | <janus> | after waiting 5 days to boot linux, you can launch microhs |
| 2026-04-13 17:48:36 | <mauke> | shapr: o/ |
| 2026-04-13 17:48:50 | <Rembane> | shapr: Hm... no, but it seems like janus does! :D |
| 2026-04-13 17:48:56 | <janus> | so surely most keyboards can run microhs, since they probably have microcontrollers at least as powerful as the intel 4004 |
| 2026-04-13 17:49:34 | <EvanR> | I college programming 101, it was stated "the keyboard is a file". If you install haskell on your keyboard, what is it now. A function? |
| 2026-04-13 17:49:49 | <shapr> | mauke: hello! |
| 2026-04-13 17:50:15 | <shapr> | I think Haskell on Keyboard is a silly project idea. |
| 2026-04-13 17:50:47 | <mauke> | why function keys if not functional programming? |
| 2026-04-13 17:50:53 | <shapr> | oooh |
| 2026-04-13 17:50:54 | <shapr> | good point! |
| 2026-04-13 17:51:08 | <shapr> | We put the Funk in Funktionelle |
| 2026-04-13 17:51:27 | <EvanR> | the keyboard is a function from Time to [Key] |
| 2026-04-13 17:51:45 | <EvanR> | the well behavedness of this function can be debated |
| 2026-04-13 17:55:21 | → | robobub joins (uid248673@id-248673.uxbridge.irccloud.com) |
| 2026-04-13 17:57:08 | × | dumptruckman quits (~dumptruck@45-79-134-140.ip.linodeusercontent.com) (Quit: ZNC - https://znc.in) |
| 2026-04-13 17:57:56 | → | arandombit joins (~arandombi@2a02:2455:8656:7100:21e4:4567:22be:8bd9) |
| 2026-04-13 17:57:56 | × | arandombit quits (~arandombi@2a02:2455:8656:7100:21e4:4567:22be:8bd9) (Changing host) |
| 2026-04-13 17:57:56 | → | arandombit joins (~arandombi@user/arandombit) |
| 2026-04-13 17:58:39 | <gentauro> | do we have multiple enum values in Haskell? F# -> `type [<Flags>] FooBar = Foo = 0 | Bar = 1 | Baz = 2 | Qux = 4`. let barQux = Bar ||| Qux`. Source: https://learn.microsoft.com/en-us/dotnet/fsharp/language-reference/enumerations#remarks |
| 2026-04-13 17:59:30 | <EvanR> | > enumFromTo 0 1 :: [Bool] |
| 2026-04-13 17:59:31 | <lambdabot> | No instance for ‘Num Bool’ arising from the literal ‘0’ |
| 2026-04-13 17:59:31 | <lambdabot> | In the first argument of ‘enumFromTo’, namely ‘0’ |
| 2026-04-13 17:59:31 | <lambdabot> | In the expression: enumFromTo 0 1 :: [Bool] |
| 2026-04-13 17:59:46 | <EvanR> | > enumFromTo False True :: [Int] |
| 2026-04-13 17:59:47 | <lambdabot> | Couldn't match expected type ‘Int’ with actual type ‘Bool’ |
| 2026-04-13 17:59:47 | <lambdabot> | In the second argument of ‘enumFromTo’, namely ‘True’ |
| 2026-04-13 17:59:47 | <lambdabot> | In the expression: enumFromTo False True :: [Int]Couldn't match expected typ... |
| 2026-04-13 17:59:59 | <EvanR> | facepalm |
| 2026-04-13 18:00:16 | <EvanR> | we have multiple enum values |
| 2026-04-13 18:00:22 | <mauke> | gentauro: no |
| 2026-04-13 18:00:24 | <gentauro> | EvanR: but that's a range right? |
| 2026-04-13 18:00:35 | <gentauro> | Flags in F# is like powers of 2 |
| 2026-04-13 18:00:45 | <EvanR> | oh |
| 2026-04-13 18:00:48 | <gentauro> | so by using the OR operator, you can store in a single enum field several values |
| 2026-04-13 18:00:58 | <EvanR> | you can express that in haskell using pattern synonyms for powers of two |
| 2026-04-13 18:01:25 | <mauke> | you can use an integer type (and bitwise or), or a set of enum values, or a record of bools |
| 2026-04-13 18:01:28 | gentauro | enums in F# are just sum-types with a numerical value |
| 2026-04-13 18:02:04 | <EvanR> | .oO( what if you made the Enum instance use powers of two instead of sequential Ints ) |
| 2026-04-13 18:02:09 | <gentauro> | mauke: yeah, that's what the F# people do with a bit of syntactic sugar |
| 2026-04-13 18:02:23 | <janus> | but you could do the same in haskell with code generation no? |
| 2026-04-13 18:03:18 | <gentauro> | I perhaps spend a bit of time on it and make it right. Perhaps it could somehow end in `base`? |
| 2026-04-13 18:03:42 | <EvanR> | :t (.|.) |
| 2026-04-13 18:03:43 | <lambdabot> | Bits a => a -> a -> a |
| 2026-04-13 18:03:48 | <EvanR> | bits class |
| 2026-04-13 18:03:50 | <gentauro> | it's really useful to use. Ex: `let logger = Info | Debug | Warning` |
| 2026-04-13 18:04:11 | → | dumptruckman joins (~dumptruck@172-104-5-126.ip.linodeusercontent.com) |
| 2026-04-13 18:04:14 | <gentauro> | EvanR: got it |
| 2026-04-13 18:04:45 | × | Milan_Vanca quits (~milan@user/Milan-Vanca:32634) (Quit: WeeChat 4.7.2) |
| 2026-04-13 18:04:51 | <janus> | i think many see the Enum class as legacy? that might mean that many people refrain from trying to improve it |
| 2026-04-13 18:04:59 | <mauke> | let logger = defaultLogger{ info = True, debug = True, warning = True } |
| 2026-04-13 18:05:02 | gentauro | define sum type. Derive `Bounded and Enum` (however Bounded needs to be powers of 2) |
| 2026-04-13 18:05:09 | <EvanR> | Info .|. Debug .|. Warning, where these are pattern synonyms |
| 2026-04-13 18:05:26 | <EvanR> | pattern Warning = 0x4 |
| 2026-04-13 18:06:06 | <mauke> | let info@debug@warning = True; logger = def{..} |
| 2026-04-13 18:06:46 | → | r1bilski joins (~r1bilski@user/r1bilski) |
| 2026-04-13 18:07:10 | <EvanR> | yeah this is the "configuration monoid" pattern where the monoid op is OR |
| 2026-04-13 18:07:30 | <EvanR> | and record inspection extracts the bits |
| 2026-04-13 18:10:27 | → | peterbecich joins (~Thunderbi@71.84.33.135) |
| 2026-04-13 18:11:16 | <janus> | gentauro: have you seen Data.Bits.Ior? |
| 2026-04-13 18:11:40 | <janus> | % import Data.Bits |
| 2026-04-13 18:11:40 | <yahb2> | <no output> |
| 2026-04-13 18:11:50 | <janus> | % getIor (Ior 0xab <> Ior 0x12) :: Word8 |
| 2026-04-13 18:11:50 | <yahb2> | <interactive>:13:34: error: [GHC-76037] ; Not in scope: type constructor or class ‘Word8’ ; Suggested fix: Perhaps use ‘Word’ (imported from Prelude) |
| 2026-04-13 18:11:58 | <janus> | oh well, you get the idea |
| 2026-04-13 18:12:36 | <mauke> | % getIor (0xab <> 0x12) |
| 2026-04-13 18:12:36 | <yahb2> | <interactive>:15:1: error: [GHC-39999] ; • No instance for ‘Num (Ior Integer)’ arising from a use of ‘it’ ; • In the first argument of ‘Yahb2Defs.limitedPrint’, namely ‘it’ ; In a stm... |
| 2026-04-13 18:12:41 | <gentauro> | janus: I think `Word8` now is `Internal` in `base` (as in `ghc-internal` |
| 2026-04-13 18:13:07 | <janus> | it might be defined in something called Internal, but it then gets re-exported |
| 2026-04-13 18:13:20 | <janus> | you can use it without issues, it's some secrit type |
| 2026-04-13 18:13:25 | <janus> | *not some secrit |
| 2026-04-13 18:14:43 | <janus> | gentauro: do you use JSON? it would be nice to have a mapping that could get emitted to OpenAPI |
| 2026-04-13 18:15:48 | <gentauro> | % import Data.Word |
| 2026-04-13 18:15:49 | <yahb2> | <no output> |
All times are in UTC.