Newest at the top
2024-05-17 15:46:04 +0200 | <[Leary]> | You may also want to generalise some functions or instances with QuantifiedConstraints; something like `(forall x. cs x => c x, c a) => a -> Entity cs -> ...` will allow you to handle any `Entity (... & c & ...)` uniformly. |
2024-05-17 15:41:04 +0200 | zer0bitz | (~zer0bitz@user/zer0bitz) |
2024-05-17 15:40:17 +0200 | ubert1 | ubert |
2024-05-17 15:40:17 +0200 | ubert | (~Thunderbi@p200300ecdf1a442d1be818c703728472.dip0.t-ipconnect.de) (Ping timeout: 256 seconds) |
2024-05-17 15:40:13 +0200 | <[Leary]> | ph88: I don't really know what you're trying to do, but `class (c1 a, c2 a) => (c1 & c2) a; instance (c1 a, c2 a) => (c1 & c2) a` will allow you to write `Entity (HasDataID & GetMessage)`. |
2024-05-17 15:35:55 +0200 | ubert1 | (~Thunderbi@p200300ecdf1a442dbe8e8c8f9360db77.dip0.t-ipconnect.de) |
2024-05-17 15:32:30 +0200 | <ph88> | i took this as a starting point https://play.haskell.org/saved/A0jyJ40g ok works. Then i wanted to add another typeclass but ran into trouble https://play.haskell.org/saved/nsO7Fn41 Managed to typecheck it like this https://play.haskell.org/saved/fYRQ1REb but the latter is coupled. Is there a way i can write this code decoupled? (see second snippet) |
2024-05-17 15:31:53 +0200 | joeyadams | (~joeyadams@2603:6010:5100:2ed:e620:4fb2:2e9f:c7fe) (Quit: Leaving) |
2024-05-17 15:31:07 +0200 | ph88 | (~ph88@2a02:8109:9e26:c800:8347:c769:dd97:86a2) |
2024-05-17 15:25:05 +0200 | igemnace | (~igemnace@user/igemnace) |
2024-05-17 15:23:42 +0200 | igemnace | (~igemnace@user/igemnace) (Quit: ZNC 1.8.2+deb2build5 - https://znc.in) |
2024-05-17 15:22:41 +0200 | machinedgod | (~machinedg@d173-183-246-216.abhsia.telus.net) |
2024-05-17 15:17:24 +0200 | raehik | (~raehik@rdng-25-b2-v4wan-169990-cust1344.vm39.cable.virginm.net) |
2024-05-17 15:14:26 +0200 | ystael | (~ystael@user/ystael) |
2024-05-17 15:13:35 +0200 | Guest13 | (~Guest13@cpc93370-hers8-2-0-cust590.6-3.cable.virginm.net) (Quit: Client closed) |
2024-05-17 15:09:05 +0200 | tromp | (~textual@92-110-219-57.cable.dynamic.v4.ziggo.nl) |
2024-05-17 14:54:19 +0200 | danse-nr3 | (~danse-nr3@151.44.168.106) |
2024-05-17 14:53:41 +0200 | danse-nr3 | (~danse-nr3@151.46.212.14) (Ping timeout: 252 seconds) |
2024-05-17 14:47:49 +0200 | <Guest13> | so memo = tabulate bounds (get memo) |
2024-05-17 14:47:20 +0200 | <Guest13> | maybe it would be best to lazily pass the memo to the "get" function and define it somewhere else? |
2024-05-17 14:46:39 +0200 | <Guest13> | it is basically same code as the unmemorised function |
2024-05-17 14:46:12 +0200 | bitdex | (~bitdex@gateway/tor-sasl/bitdex) (Quit: = "") |
2024-05-17 14:45:53 +0200 | <Guest13> | and my answer is contained within (0,0,0) |
2024-05-17 14:45:17 +0200 | <Guest13> | I have a function "get" which is meant to be the recursive part which refers to the memoized array inside it |
2024-05-17 14:44:25 +0200 | joeyadams | (~joeyadams@2603:6010:5100:2ed:e620:4fb2:2e9f:c7fe) |
2024-05-17 14:43:20 +0200 | <Guest13> | https://play.haskell.org/saved/WOB84oaz |
2024-05-17 14:40:28 +0200 | <Guest13> | sorry ill send a link |
2024-05-17 14:39:39 +0200 | <yushyin> | pls ... |
2024-05-17 14:39:38 +0200 | <Guest13> | groupTarget = grps !! grp |
2024-05-17 14:39:38 +0200 | <Guest13> | where cur = springs !! I |
2024-05-17 14:39:37 +0200 | <Guest13> | | otherwise = undefined |
2024-05-17 14:39:37 +0200 | <Guest13> | | cur == Unknown = dotCase + hashCase |
2024-05-17 14:39:36 +0200 | <Guest13> | | cur == Damaged = hashCase |
2024-05-17 14:39:36 +0200 | <Guest13> | | cur == Operational = dotCase |
2024-05-17 14:39:35 +0200 | <Guest13> | | grp == length grps = if ((springs !! i) == Damaged) then 0 else dotCase -- matched all groups |
2024-05-17 14:39:35 +0200 | <Guest13> | | i == length springs = if (count == 0 && grp == length grps) then 1 else endOnHash -- end of springs |
2024-05-17 14:39:34 +0200 | <Guest13> | get ixx@(i, grp, count) |
2024-05-17 14:39:34 +0200 | <Guest13> | memo = tabulate bounds get |
2024-05-17 14:39:33 +0200 | <Guest13> | where bounds = ((0,0,0), (length springs, length grps, length springs)) |
2024-05-17 14:39:33 +0200 | <Guest13> | | otherwise = memo ! ix |
2024-05-17 14:39:32 +0200 | <Guest13> | | count < 0 || count > length springs = undefined |
2024-05-17 14:39:32 +0200 | <Guest13> | | grp < 0 || grp > length grps = undefined |
2024-05-17 14:39:31 +0200 | <Guest13> | | i < 0 || i > length springs = undefined |
2024-05-17 14:39:31 +0200 | <Guest13> | permutationsMemo problem@(springs, grps) ix@(i, grp, count) |
2024-05-17 14:39:30 +0200 | <Guest13> | permutationsMemo :: Problem -> (Int, Int, Int) -> Int |
2024-05-17 14:39:30 +0200 | <Guest13> | mine looks like: |
2024-05-17 14:38:50 +0200 | <Guest13> | [Leary] I have no clue what is going on there XD |
2024-05-17 14:37:49 +0200 | <ski> | nice, Guest13 ! |
2024-05-17 14:32:20 +0200 | <[Leary]> | Check the link? |
2024-05-17 14:32:07 +0200 | <Guest13> | ah what's that? |