Logs: liberachat/#haskell
| 2021-06-04 09:43:12 | <absence> | i have this contrived c and haskell code: https://pastebin.com/EbegpS7Q after printing "in c before callback" and "in haskell", it just hangs. does throwing an exception in this way violate some ffi rule? can i get it working somehow? |
| 2021-06-04 09:46:20 | → | dunkeln joins (~dunkeln@94.129.65.28) |
| 2021-06-04 09:47:50 | → | ddellaco_ joins (~ddellacos@86.106.121.20) |
| 2021-06-04 09:48:27 | × | chomwitt quits (~Pitsikoko@2a02:587:dc02:b00:b16c:5166:feb8:97d5) (Ping timeout: 272 seconds) |
| 2021-06-04 09:51:38 | → | mpt joins (~tom@p57a566da.dip0.t-ipconnect.de) |
| 2021-06-04 09:52:00 | × | ddellaco_ quits (~ddellacos@86.106.121.20) (Ping timeout: 245 seconds) |
| 2021-06-04 09:58:45 | → | MrKaKe joins (~bo@2a01:79c:cebf:d688::9e6) |
| 2021-06-04 09:58:50 | × | econo quits (uid147250@user/econo) (Quit: Connection closed for inactivity) |
| 2021-06-04 09:59:12 | MrKaKe | is now known as bjobjo |
| 2021-06-04 10:00:02 | × | pavonia quits (~user@user/siracusa) (Quit: Bye!) |
| 2021-06-04 10:01:01 | → | dario joins (~dario@8.43.122.4) |
| 2021-06-04 10:03:13 | → | node-sh joins (~node-sh@2401:4900:3b29:78ba:5b23:3841:af60:74fd) |
| 2021-06-04 10:03:46 | → | boxscape joins (~boxscape@user/boxscape) |
| 2021-06-04 10:03:58 | → | ddellaco_ joins (~ddellacos@86.106.121.20) |
| 2021-06-04 10:06:10 | × | fabfianda quits (~fabfianda@mob-5-90-247-167.net.vodafone.it) (Ping timeout: 245 seconds) |
| 2021-06-04 10:07:12 | → | fabfianda joins (~fabfianda@net-93-148-121-206.cust.vodafonedsl.it) |
| 2021-06-04 10:07:15 | × | derelict quits (~winter@2603-6011-f901-9e5b-aed0-a4c6-fbb9-1828.res6.spectrum.com) (Ping timeout: 272 seconds) |
| 2021-06-04 10:08:15 | × | ddellaco_ quits (~ddellacos@86.106.121.20) (Ping timeout: 245 seconds) |
| 2021-06-04 10:08:17 | × | bjobjo quits (~bo@2a01:79c:cebf:d688::9e6) (Quit: Reconnecting) |
| 2021-06-04 10:08:17 | <boxscape> | Is there some sense in which [a] fits the description "free monoid on a" closer than does Seq a? Or are they equally good? |
| 2021-06-04 10:08:24 | → | bjobjo joins (~bo@2a01:79c:cebf:d688::9e6) |
| 2021-06-04 10:09:19 | → | fizbin joins (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) |
| 2021-06-04 10:09:48 | <river> | @src Seq |
| 2021-06-04 10:09:48 | <lambdabot> | Source not found. This mission is too important for me to allow you to jeopardize it. |
| 2021-06-04 10:09:54 | <river> | whats seq? |
| 2021-06-04 10:10:04 | <boxscape> | % :i Seq |
| 2021-06-04 10:10:04 | <yahb> | boxscape: ; <interactive>:1:1: error: Not in scope: `Seq' |
| 2021-06-04 10:10:08 | <c_wraith> | They're both sort of bad, in that they have more to the data structure than a free monoid |
| 2021-06-04 10:10:12 | <boxscape> | % :i Data.Sequence.Seq |
| 2021-06-04 10:10:14 | <yahb> | boxscape: *** Exception: heap overflow |
| 2021-06-04 10:10:19 | <boxscape> | c_wraith okay, that does make sense |
| 2021-06-04 10:10:21 | <c_wraith> | river: https://hackage.haskell.org/package/containers-0.6.4.1/docs/Data-Sequence.html |
| 2021-06-04 10:10:25 | <boxscape> | wait heap overflow? |
| 2021-06-04 10:10:47 | <boxscape> | c_wraith is there a way to make a free monoid in haskell without superfluous structure? |
| 2021-06-04 10:10:52 | <wz1000> | boxscape: Seq is better, since the free monoidis defined to be strictly finite strings |
| 2021-06-04 10:11:01 | <boxscape> | hm I see |
| 2021-06-04 10:11:09 | <c_wraith> | :t foldMap |
| 2021-06-04 10:11:10 | <lambdabot> | (Foldable t, Monoid m) => (a -> m) -> t a -> m |
| 2021-06-04 10:11:32 | × | bjobjo quits (~bo@2a01:79c:cebf:d688::9e6) (Client Quit) |
| 2021-06-04 10:11:39 | → | bjobjo joins (~bo@2a01:79c:cebf:d688::9e6) |
| 2021-06-04 10:12:08 | <c_wraith> | forall m. Monoid m => (a -> m) -> m is a free monoid on a |
| 2021-06-04 10:12:19 | <c_wraith> | It's not a satisfying one in a lot of ways |
| 2021-06-04 10:12:22 | <boxscape> | I see |
| 2021-06-04 10:12:25 | × | merijn quits (~merijn@83-160-49-249.ip.xs4all.nl) (Ping timeout: 245 seconds) |
| 2021-06-04 10:12:32 | <pja> | absence: https://downloads.haskell.org/~ghc/8.4.2/docs/html/users_guide/ffi-chap.html#on-the-use-of-hs-exit & http://neilmitchell.blogspot.com/2017/11/haskell-exceptions-and-ffi-wrappers.html seem relevant links. |
| 2021-06-04 10:12:33 | <c_wraith> | But it is *exactly* the amount of structure you need |
| 2021-06-04 10:12:45 | <boxscape> | okay |
| 2021-06-04 10:13:15 | × | bjobjo quits (~bo@2a01:79c:cebf:d688::9e6) (Changing host) |
| 2021-06-04 10:13:15 | → | bjobjo joins (~bo@user/bjobjo) |
| 2021-06-04 10:13:32 | <dminuoso> | % :i Data.Sequence.Seq |
| 2021-06-04 10:13:33 | <yahb> | dminuoso: *** Exception: heap overflow |
| 2021-06-04 10:13:37 | <dminuoso> | What's going on here? |
| 2021-06-04 10:13:42 | <boxscape> | no idea |
| 2021-06-04 10:14:05 | <pja> | absence: You have a thread which is blocked in an FFI call & you’ve thrown an uncaught exception. hs_exit() is blocked waiting for a thread exit which can never happen. |
| 2021-06-04 10:14:10 | × | fizbin quits (~fizbin@c-73-33-197-160.hsd1.nj.comcast.net) (Ping timeout: 272 seconds) |
| 2021-06-04 10:14:16 | <dminuoso> | Seems to work fine on GHCi 8.8.4 |
| 2021-06-04 10:14:24 | <dminuoso> | Perhaps this is bug in most recent GHC? |
| 2021-06-04 10:14:34 | <boxscape> | let me check |
| 2021-06-04 10:14:53 | <dminuoso> | (Possibly the version/flags of the containers package might be relevant too) |
| 2021-06-04 10:14:59 | <boxscape> | works in 8.10 and HEAD, so if it was broken it's fixed now |
| 2021-06-04 10:15:06 | <boxscape> | I don't have yahb's ghc version installed |
| 2021-06-04 10:15:19 | <dminuoso> | What verison is yahb running? I forgot the command |
| 2021-06-04 10:15:20 | × | dhil quits (~dhil@195.213.192.47) (Ping timeout: 245 seconds) |
| 2021-06-04 10:15:26 | <boxscape> | % :!ghc --version |
| 2021-06-04 10:15:26 | <yahb> | boxscape: The Glorious Glasgow Haskell Compilation System, version 9.0.1 |
| 2021-06-04 10:16:51 | <absence> | pja: thanks, i'll have a look at the text and see if i get a better understanding |
| 2021-06-04 10:18:23 | <boxscape> | dminuoso I think I've used :i on yahb with this ghc version before without running into this... |
| 2021-06-04 10:18:36 | × | Erutuon quits (~Erutuon@user/erutuon) (Ping timeout: 272 seconds) |
| 2021-06-04 10:19:41 | <pja> | absence: NB. I haven’t actually run your code and checked; my reading may be erroneous :) |
| 2021-06-04 10:20:28 | <boxscape> | % :i ala |
| 2021-06-04 10:20:29 | <yahb> | boxscape: ala :: (Functor f, Rewrapping s t) => (Unwrapped s -> s) -> ((Unwrapped t -> t) -> f s) -> f (Unwrapped s) -- Defined in `Control.Lens.Wrapped' |
| 2021-06-04 10:20:32 | <boxscape> | oh |
| 2021-06-04 10:20:37 | <boxscape> | % :i Bool |
| 2021-06-04 10:20:37 | <yahb> | boxscape: *** Exception: heap overflow |
| 2021-06-04 10:20:43 | <Hecate> | nice |
| 2021-06-04 10:20:45 | <boxscape> | I guess it doesn't affect functions |
| 2021-06-04 10:20:52 | <dminuoso> | % :q |
| 2021-06-04 10:20:52 | <yahb> | dminuoso: |
| 2021-06-04 10:20:54 | <dminuoso> | % :i Bool |
| 2021-06-04 10:20:56 | <yahb> | dminuoso: type Bool :: *; data Bool = False | True; -- Defined in `GHC.Types'; instance Eq Bool -- Defined in `GHC.Classes'; instance Ord Bool -- Defined in `GHC.Classes'; instance Enum Bool -- Defined in `GHC.Enum'; instance Show Bool -- Defined in `GHC.Show'; instance Data Bool -- Defined in `Data.Data'; instance Lift Bool -- Defined in `Language.Haskell.TH.Syntax'; instance Bits Bool -- Defined in `Data.Bits' |
| 2021-06-04 10:21:01 | <boxscape> | ah, that's better |
| 2021-06-04 10:21:13 | <dminuoso> | Now Im curious |
| 2021-06-04 10:21:16 | × | yd502__ quits (~yd502@180.168.212.6) (Remote host closed the connection) |
| 2021-06-04 10:21:18 | <dminuoso> | Whether that was the wrapper itself, or the GHCi |
| 2021-06-04 10:21:25 | <dminuoso> | The latter would be a really weird bug |
| 2021-06-04 10:21:29 | → | yd502__ joins (~yd502@180.168.212.6) |
| 2021-06-04 10:21:36 | <boxscape> | hm the wrapper is written is haskell, right? |
| 2021-06-04 10:21:56 | <boxscape> | (otherwise the "*** Exception" part of the message would indicate the latter) |
| 2021-06-04 10:22:02 | <dminuoso> | mniip might note |
| 2021-06-04 10:22:04 | <dminuoso> | know even. |
| 2021-06-04 10:22:08 | → | dyeplexer joins (~dyeplexer@user/dyeplexer) |
| 2021-06-04 10:23:05 | × | mpt quits (~tom@p57a566da.dip0.t-ipconnect.de) (Ping timeout: 272 seconds) |
| 2021-06-04 10:25:34 | × | FragByte quits (~christian@user/fragbyte) (Quit: Quit) |
| 2021-06-04 10:25:40 | × | MQ-17J quits (~MQ-17J@d14-69-206-129.try.wideopenwest.com) (Remote host closed the connection) |
| 2021-06-04 10:25:55 | → | MQ-17J joins (~MQ-17J@d14-69-206-129.try.wideopenwest.com) |
| 2021-06-04 10:26:42 | <boxscape> | dminuoso once ghci encounters a heap overflow, entering any expression might result in the same heap overflow message again https://gitlab.haskell.org/ghc/ghc/-/issues/14358 - though if this was the problem, that wouldn't explain why :i ala worked |
| 2021-06-04 10:26:47 | → | chomwitt joins (~Pitsikoko@athedsl-20549.home.otenet.gr) |
| 2021-06-04 10:27:39 | → | FragByte joins (~christian@user/fragbyte) |
| 2021-06-04 10:28:50 | → | peterhil joins (~peterhil@dsl-hkibng32-54f849-252.dhcp.inet.fi) |
| 2021-06-04 10:28:54 | <dminuoso> | % let xs = [1..10^6] :: [Int] |
All times are in UTC.