Logs: freenode/#haskell
| 2020-10-02 11:09:25 | <tomsmeding> | megaparsec is monadic parsing, right? |
| 2020-10-02 11:09:43 | <tomsmeding> | applicative parsing is strictly weaker than monadic parsing, so unless it has two completely distinct parsing engines under the hood, I think it doesn't |
| 2020-10-02 11:09:58 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-10-02 11:10:15 | <tomsmeding> | https://stackoverflow.com/questions/7861903/what-are-the-benefits-of-applicative-parsing-over-monadic-parsing |
| 2020-10-02 11:10:15 | <ski> | i suppose you could also try something like <https://hackage.haskell.org/package/base-4.14.0.0/docs/Text-ParserCombinators-ReadP.html> or <https://hackage.haskell.org/package/base-4.14.0.0/docs/Text-ParserCombinators-ReadP.html> |
| 2020-10-02 11:10:26 | <tomsmeding> | same link? |
| 2020-10-02 11:11:34 | → | niko joins (~niko@freenode/staff/ubuntu.member.niko) |
| 2020-10-02 11:11:35 | × | noobhaskell quits (6763cd07@103.99.205.7) (Remote host closed the connection) |
| 2020-10-02 11:11:44 | × | conal quits (~conal@107.181.166.148) (Read error: Connection reset by peer) |
| 2020-10-02 11:12:07 | <tomsmeding> | ski: looks cool, TIL |
| 2020-10-02 11:12:58 | hackage | nri-prelude 0.1.0.1 - A Prelude inspired by the Elm programming language https://hackage.haskell.org/package/nri-prelude-0.1.0.1 (JasperWoudenberg) |
| 2020-10-02 11:14:36 | <tomsmeding> | ski: is that able to optimise (string "prefixA" >> return 1) +++ (string "prefixB" >> return 2) to something like string "prefix" >> ((char 'A' >> return 1) +++ (char 'B' >> return 2)) ? |
| 2020-10-02 11:14:37 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 264 seconds) |
| 2020-10-02 11:15:20 | <tomsmeding> | ah the ReadP representation is CPS'ed, so I guess not |
| 2020-10-02 11:16:57 | hackage | fused-effects-readline 0.1.0.1 - A readline-like effect and carrier for fused-effects https://hackage.haskell.org/package/fused-effects-readline-0.1.0.1 (robrix) |
| 2020-10-02 11:16:57 | → | conal joins (~conal@107.181.166.148) |
| 2020-10-02 11:17:36 | × | HaskellYogi quits (~vivekrama@49.207.202.80) (Ping timeout: 272 seconds) |
| 2020-10-02 11:17:42 | <tomsmeding> | or perhaps it does, there's some magic going on with the P type |
| 2020-10-02 11:20:19 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-10-02 11:21:04 | <maralorn> | I think I need interact where the function can be IO … |
| 2020-10-02 11:21:24 | → | snakemasterflex joins (~snakemast@213.100.206.23) |
| 2020-10-02 11:21:28 | <tomsmeding> | okay so it kind of does: the implementation of +++ via <|> does combine Look, and later Get values, but I think there's still some kind of double work performed but not sure |
| 2020-10-02 11:22:05 | <tomsmeding> | :t \f -> getContents >>= f >>= putStr |
| 2020-10-02 11:22:07 | <lambdabot> | (String -> IO String) -> IO () |
| 2020-10-02 11:22:10 | <tomsmeding> | maralorn: ^ |
| 2020-10-02 11:22:12 | <tomsmeding> | :p |
| 2020-10-02 11:22:35 | <maralorn> | Also: Looks right.^^ |
| 2020-10-02 11:23:18 | <ski> | what `IO' do you want/need ? |
| 2020-10-02 11:23:35 | → | HaskellYogi joins (~vivekrama@49.207.202.80) |
| 2020-10-02 11:23:51 | <maralorn> | ski: I want to e.g. put a current timestamp into my output. |
| 2020-10-02 11:24:28 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 246 seconds) |
| 2020-10-02 11:24:31 | <maralorn> | Or query the system for additional info about the input I am getting. |
| 2020-10-02 11:24:50 | <maralorn> | I wonder if I should look into a Streaming lib. |
| 2020-10-02 11:25:46 | <tomsmeding> | maralorn: caution: that expression doesn't work, it blocks until the entire input is read apparently |
| 2020-10-02 11:27:00 | <ski> | if timestamps are always put in the same place in the generated lines, perhaps you could (incrementally) generate a list of `String's, and then insert the timestamps as you output the lines |
| 2020-10-02 11:28:06 | <maralorn> | I think my Plan would be right now to do something like having a "Parser [ParseResult]", a function "ParseResult -> IO Text", map that to something like [ParseResult] -> IO [Text] and then return the concatenation of that … |
| 2020-10-02 11:28:11 | × | HaskellYogi quits (~vivekrama@49.207.202.80) (Ping timeout: 240 seconds) |
| 2020-10-02 11:28:27 | hackage | nri-prelude 0.1.0.2 - A Prelude inspired by the Elm programming language https://hackage.haskell.org/package/nri-prelude-0.1.0.2 (JasperWoudenberg) |
| 2020-10-02 11:28:40 | → | raehik joins (~raehik@cpc96984-rdng25-2-0-cust109.15-3.cable.virginm.net) |
| 2020-10-02 11:28:43 | <maralorn> | Where I would write the Parser in a way that could never fail. |
| 2020-10-02 11:29:02 | <ski> | tomsmeding : you could sprinkle `unsafeInterleaveIO' :) |
| 2020-10-02 11:29:31 | × | borne quits (~fritjof@200116b8644ae80007933c164a08810c.dip.versatel-1u1.de) (Ping timeout: 272 seconds) |
| 2020-10-02 11:29:34 | → | inkbottle joins (~inkbottle@aaubervilliers-654-1-1-33.w83-200.abo.wanadoo.fr) |
| 2020-10-02 11:29:49 | → | urodna joins (~urodna@unaffiliated/urodna) |
| 2020-10-02 11:30:04 | × | zebrag quits (~inkbottle@aaubervilliers-654-1-117-166.w86-198.abo.wanadoo.fr) (Ping timeout: 246 seconds) |
| 2020-10-02 11:30:16 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-10-02 11:30:27 | hackage | nri-env-parser 0.1.0.1 - Read environment variables as settings to build 12-factor apps. https://hackage.haskell.org/package/nri-env-parser-0.1.0.1 (JasperWoudenberg) |
| 2020-10-02 11:30:45 | → | borne joins (~fritjof@200116b864545000eb24a00afefc421b.dip.versatel-1u1.de) |
| 2020-10-02 11:30:53 | <tomsmeding> | or use |
| 2020-10-02 11:30:59 | <tomsmeding> | :t \f -> getContents >>= mapM_ (f >=> putStrLn) . lines |
| 2020-10-02 11:31:00 | <lambdabot> | (String -> IO String) -> IO () |
| 2020-10-02 11:31:10 | <tomsmeding> | which runs f for every line :) |
| 2020-10-02 11:31:59 | → | hekkaidekapus_ joins (~tchouri@gateway/tor-sasl/hekkaidekapus) |
| 2020-10-02 11:32:12 | <maralorn> | tomsmeding: Yeah, but sometimes the Parser needs to consume multiple lines |
| 2020-10-02 11:33:50 | → | Tops2 joins (~Tobias@dyndsl-095-033-022-004.ewe-ip-backbone.de) |
| 2020-10-02 11:34:23 | × | hekkaidekapus quits (~tchouri@gateway/tor-sasl/hekkaidekapus) (Ping timeout: 240 seconds) |
| 2020-10-02 11:35:03 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 260 seconds) |
| 2020-10-02 11:35:58 | → | jonatanb joins (~jonatanb@83.24.231.247.ipv4.supernova.orange.pl) |
| 2020-10-02 11:36:41 | → | TCZ joins (~TCZ@ip-91.246.66.111.skyware.pl) |
| 2020-10-02 11:36:58 | <orzo> | I'm trying to do scalar multiplication with hmatrix's type-safe "static" vectors http://dis.um.es/~alberto/hmatrix/static.html |
| 2020-10-02 11:37:05 | <orzo> | i can't figure it out |
| 2020-10-02 11:37:06 | → | polyrain joins (~polyrain@2001:8003:640b:b900:3932:cca7:5271:9742) |
| 2020-10-02 11:37:11 | ← | TCZ parts (~TCZ@ip-91.246.66.111.skyware.pl) ("Leaving") |
| 2020-10-02 11:37:14 | × | Tops21 quits (~Tobias@dyndsl-095-033-022-004.ewe-ip-backbone.de) (Ping timeout: 272 seconds) |
| 2020-10-02 11:40:30 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-10-02 11:41:15 | <orzo> | do i have to convert it to a dynamic vector just to multiply it by a scalar? |
| 2020-10-02 11:41:19 | → | todda7 joins (~torstein@athedsl-4367507.home.otenet.gr) |
| 2020-10-02 11:42:05 | × | zaquest quits (~notzaques@5.128.210.178) (Quit: Leaving) |
| 2020-10-02 11:42:27 | × | jgt quits (~jgt@188.239.64.32) (Ping timeout: 240 seconds) |
| 2020-10-02 11:44:59 | × | heatsink quits (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) (Ping timeout: 256 seconds) |
| 2020-10-02 11:45:06 | → | drbean joins (~drbean@TC210-63-209-213.static.apol.com.tw) |
| 2020-10-02 11:45:26 | <opqdonut> | orzo: is * perhaps element-wise multiplication? so you could create a constant matrix of the same size and then use * |
| 2020-10-02 11:46:07 | <opqdonut> | so something like 'fromInteger 3 * mat' should work as far as I can see |
| 2020-10-02 11:46:24 | <opqdonut> | but I'm just curious and reading the docs, I haven't used hmatrix |
| 2020-10-02 11:46:27 | <tomsmeding> | orzo: https://hackage.haskell.org/package/hmatrix-0.20.0.0/docs/Numeric-LinearAlgebra.html#g:3 seems to suggest '3 * mat' should work |
| 2020-10-02 11:46:40 | <tomsmeding> | though that does create a dynamic vector behind the scenes |
| 2020-10-02 11:46:58 | <tomsmeding> | (if you follow the Num and >< definitions in the source) |
| 2020-10-02 11:47:25 | <tomsmeding> | perhaps Vector fusion does magic and eliminates that intermediate vector? /shrug/ |
| 2020-10-02 11:48:02 | → | thir joins (~thir@p200300f27f0fc60004d129737887aa72.dip0.t-ipconnect.de) |
| 2020-10-02 11:48:10 | × | Stanley00 quits (~stanley00@unaffiliated/stanley00) (Remote host closed the connection) |
| 2020-10-02 11:48:47 | × | alx741_ quits (~alx741@186.178.110.227) (Ping timeout: 265 seconds) |
| 2020-10-02 11:50:02 | <phadej> | probably no |
| 2020-10-02 11:50:35 | <tomsmeding> | ah there is 'scale :: t -> Matrix t -> Matrix t' |
| 2020-10-02 11:50:43 | <tomsmeding> | orzo: ^ |
| 2020-10-02 11:52:07 | × | thir quits (~thir@p200300f27f0fc60004d129737887aa72.dip0.t-ipconnect.de) (Ping timeout: 240 seconds) |
| 2020-10-02 11:52:33 | <tomsmeding> | and that seems to call out to a foreign C function via some detours |
| 2020-10-02 11:53:43 | <tomsmeding> | (scale comes from the Linear typeclass) |
| 2020-10-02 11:55:28 | hackage | stylish-haskell 0.12.0.0 - Haskell code prettifier https://hackage.haskell.org/package/stylish-haskell-0.12.0.0 (JasperVanDerJeugt) |
| 2020-10-02 11:56:46 | <maralorn> | Wait, I can‘t have a lazy Parser, can I? At least parse :: s -> Either (ParseErrorBundle s e) a will be strict in the Either, so it needs to consume all input until it knows, it it succeeded, right? |
| 2020-10-02 11:58:08 | <ski> | i guess if you assume your input is well-formed, don't care about potential errors, then you could be more lazy |
| 2020-10-02 12:00:01 | × | Frost1 quits (~Frost@84.39.117.57) () |
| 2020-10-02 12:00:39 | → | heatsink joins (~heatsink@107-136-5-69.lightspeed.sntcca.sbcglobal.net) |
| 2020-10-02 12:01:11 | × | snakemasterflex quits (~snakemast@213.100.206.23) (Ping timeout: 260 seconds) |
| 2020-10-02 12:01:19 | → | alx741_ joins (~alx741@181.196.69.166) |
| 2020-10-02 12:01:52 | × | zabracks quits (sid322453@gateway/web/irccloud.com/x-quucjgaiznbgmxnq) (Quit: Connection closed for inactivity) |
| 2020-10-02 12:03:07 | × | p-core quits (~Thunderbi@2001:718:1e03:5128:2ab7:7f35:48a1:8515) (Quit: p-core) |
| 2020-10-02 12:03:31 | × | DirefulSalt quits (DirefulSal@gateway/vpn/privateinternetaccess/direfulsalt) (Remote host closed the connection) |
| 2020-10-02 12:03:39 | <maralorn> | Yeah, it makes sense in my head. But I don‘t finde a lib which can do it. |
| 2020-10-02 12:03:43 | → | p-core joins (~Thunderbi@2001:718:1e03:5128:2ab7:7f35:48a1:8515) |
| 2020-10-02 12:03:44 | → | Amras joins (~Amras@unaffiliated/amras0000) |
All times are in UTC.