profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/neongreen/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Artyom Kazak neongreen Co-founder: @monadfix, @brickdo https://artyom.me

commercialhaskell/stack 3602

The Haskell Tool Stack

agrafix/superrecord 80

Haskell: Supercharged anonymous records

int-index/ether 76

Monad Transformers and Classes

ChrisKuklewicz/regex-tdfa 39

A new all Haskell "tagged" DFA regex engine, inspired by libtre

juspay/jrec 28

Literally the best anonymous records

haskell-hvr/regex-tdfa 19

Pure Haskell Tagged DFA Backend for "Text.Regex" (regex-base)

monadfix/shower 18

Clean up the formatting of 'show' output

Kuratoro/haskell.zettel.page 17

Haskell knowledgebase, Zettelkasten style (~2 months experiment, which resulted in migration to srid.ca)

kowainik/ilist 10

ℹ️ Index-related functions for lists

issue commentueberdosis/tiptap

Don't apply typography when inside code

The Code mark.

neongreen

comment created time in 4 days

issue commentckeditor/ckeditor5

Media Embed Automatic Embeds: Per provider configuration

where we wanted some domains to automatically paste (e.g. YouTube) but other providers we allow, they'd paste via clicking the button. There wasn't a way to this without the PR, since there was no way to opt-out of automatic embedding. It was hard coded.

Exactly this.

We are using embedly, and they can generate a decent-looking link preview for pretty much any link (think "link bookmarks" in Notion). They also have a constantly updating list of providers they support. Ideally we just want to allow any link in the "insert media" button — embedly will handle it.

However, we definitely don't want all links to turn into embed widgets on paste. We actually rolled this out and users are frustrated.

FWIW, having a Nimbus-style embed menu would solve this problem:

image

But until then we would like to be able to configure autoembeds to fire only for specific providers (YouTube, etc) where we know that most of the time users want those to be autoembedded.

tony

comment created time in 8 days

issue openedueberdosis/tiptap

Don't apply typography when inside code

When I'm inside a <code> node, I usually don't want to replace -- with a dash, or have curly quotes, etc. It would be nice to disable typography there.

created time in 11 days

issue openedckeditor/ckeditor5

Undoing an embed conversion should result in a normal link

📝 Provide a description of the improvement

Right now, if you paste a link and it turns into an embed, pressing Ctrl+Z will result in a plaintext link (without <a>). This is inconvenient when e.g. using embedly for all links (/.+/ as the URL regex).

I think that pressing Ctrl+Z should result in a normal link with <a>. Perhaps this should be configurable, but I'm not sure.


If you'd like to see this improvement implemented, add a 👍 reaction to this post.

created time in 14 days

issue closedckeditor/ckeditor5

Enable/disable previewsInData per-provider

📝 Provide a description of the improvement

I want to use previewsInData for a few popular media providers like YouTube to get faster loading experience for popular embeds. For all other embeds, I want to use embedly and disable previewsInData. Is it possible?


If you'd like to see this improvement implemented, add a 👍 reaction to this post.

closed time in 14 days

neongreen

issue commentckeditor/ckeditor5

Enable/disable previewsInData per-provider

I'll close this then, although I feel being able to override previewsInData could still be useful.

neongreen

comment created time in 14 days

issue commentckeditor/ckeditor5

Enable/disable previewsInData per-provider

Oh, I can just enable previewsInData and omit the html: key for the embedly provider.

neongreen

comment created time in 14 days

issue openedckeditor/ckeditor5

Enable/disable previewsInData per-provider

📝 Provide a description of the improvement

I want to use previewsInData for a few popular media providers like YouTube to get faster loading experience for popular embeds. For all other embeds, I want to use embedly and disable previewsInData. Is it possible?


If you'd like to see this improvement implemented, add a 👍 reaction to this post.

created time in 14 days

issue commentckeditor/ckeditor5

Add support for asynchronous oEmbed services

I checked and it does seem to pick up new additions to the DOM.

Reinmar

comment created time in 14 days

issue commentdigitallyinduced/ihp

AutoRoute doesn't work with non-primitive types well

I think we can't make this a compile-time error without either generics (normal/sop/etc) or TH.

neongreen

comment created time in 14 days

issue commentProseMirror/prosemirror

How to exit code block when cursor at last

Btw, Remirror somehow does it. I haven't yet figured out how.

keelii

comment created time in 16 days

issue commentdigitallyinduced/ihp

AutoRoute doesn't work with non-primitive types well

We switched from GHC.Generics to generics-sop at Juspay and there was a significant improvement in compilation time — but it's hard to say whether the slowdown after switching from Data.Data will be negligible, or 1.5x, or 2x, or who knows what. At least they are not quadratic-time, though.

neongreen

comment created time in 19 days

issue commentdigitallyinduced/ihp

AutoRoute doesn't work with non-primitive types well

I am also curious if you had evaluated generics-sop when deciding to ban generics. generics-sop has a TH-based generator that doesn't rely on GHC.Generics, and the resulting generics instances are much faster to compile (while being correspondingly slower at runtime, but Data.Data has the same story).

neongreen

comment created time in 20 days

IssuesEvent

issue commentdigitallyinduced/ihp

AutoRoute doesn't work with non-primitive types well

I've looked at the sources of AutoRoute some more.

First of all, the arguments parser that tries to parse Show-generated output is buggy — it doesn't work when one of the params contained inside the controller is a record. This can be fixed by using one of the available Show-output parsers, e.g. shower or pretty-show or pretty-simple. I recommend doing this regardless, just because a) it's going to remove a piece of annoying code from the IHP codebase and is going to be b) strictly less buggy.

Secondly, using Show on non-primitive types is (mostly?) useless if you don't use Read to read those non-primitive types back. So you'd need a way to get a Read instance at runtime when parsing the query back into the controller.

You can't use Read controller => as an AutoRoute constraint because it won't give you Read constraints for the controller fields. You could do something like All Read (GetFields controller), but this requires generics.

I think that a working option is to use https://github.com/litxio/instance-map, which is implemented via TH and will require just one TH invocation (per codebase, not per type) to allow you to query things like "give me the Read instance if it exists" inside the parser.

If you add Read/Show instances for Id', which you can do because you control all generated Id' types, you won't need autoRouteWithIdType either.

If you want to give users control over rendering non-primitive parameter fields, you shouldn't use Read and Show at all and replace them with a QueryParam class that would provide both a parser and a renderer. This will be a breaking change, but since you're not using Read, all user-written code that actually uses the Show fallback is also probably failing at runtime.

neongreen

comment created time in 20 days

fork neongreen/ihp

🔥 The fastest way to build type safe web apps. IHP is a new batteries-included web framework optimized for longterm productivity and programmer happiness

https://ihp.digitallyinduced.com/

fork in 20 days

issue commentdigitallyinduced/ihp

AutoRoute fails with certain ADTs as params

This would also likely let you get rid of autoRouteWithIdType — instead, the codegen will have to register a single Id' x handler per model.

neongreen

comment created time in 21 days

issue commentdigitallyinduced/ihp

AutoRoute fails with certain ADTs as params

Alright.

Another option is to create a global registry that will be used during runtime dispatch — imagine an IORef with a typerep-map inside. Handlers for specific types could be added in a centralized place somewhere in the application, and the dispatch inside AutoRoute would throw a descriptive error if the type isn't found in the registry.

neongreen

comment created time in 21 days

issue commentdigitallyinduced/ihp

AutoRoute fails with certain ADTs as params

(generics-eot reuses GHC.Generics)

neongreen

comment created time in 22 days

issue commentdigitallyinduced/ihp

AutoRoute fails with certain ADTs as params

Btw I'll be happy to code this up in a stream on Saturday — although first I'd like to hear why you decided against GHC.Generics. Maybe what I'm proposing is harder than I think.

neongreen

comment created time in 22 days

issue commentdigitallyinduced/ihp

AutoRoute fails with certain ADTs as params

In fact, you can't do that even non-trivially, because custom Typeable instances aren't supported. (Otherwise I would've just written a custom Data instance that lies to AutoRoute.)

neongreen

comment created time in 22 days

issue commentdigitallyinduced/ihp

AutoRoute fails with certain ADTs as params

The downside of using runtime dispatch instead of compile-time dispatch is exactly that overriding things becomes hard. You can supply a new Param instance trivially, but you can't trivially supply an extra branch case into a function deep in IHP.

neongreen

comment created time in 22 days

issue commentdigitallyinduced/ihp

AutoRoute fails with certain ADTs as params

GHC.Generics is a bit tricky to use, but something like generics-eot should be pretty simple. I wrote a tutorial here: https://tek.brick.do/generics-are-simple-write-your-own-to-json-9AM0Bz8yBZBP.

class Param a where parseParam :: ...
instance Param Text where ...
instance Param Int where ...

class AutoRoute controller where
  autoRoute :: Parser controller
  default autoRoute :: (HasEot controller, GAutoRoute (Eot controller)) => Parser controller

Eot will simply represent the action as an Either branch with a tuple inside. You will also have access to the constructor name.

After that, GAutoRoute will use Param for the individual fields. The upside is that anybody can write their own Param instance or use deriving via to specify that they want to go via Read/Show:

deriving Param X via (ParamViaShow X)

Where ParamViaShow will be a newtype wrapper provided by IHP.

neongreen

comment created time in 22 days

issue commentdigitallyinduced/ihp

AutoRoute fails with certain ADTs as params

Would also be nice if AutoRoute was using smth like class AutoRouteParam instead of Data (with an overlapping instance going via Data), because currently I don't think I have any way to override the parsing for ReplySource.

neongreen

comment created time in 22 days

issue closeddigitallyinduced/ihp

AutoRoute fails with certain ADTs as params

I am using IHP 0.14.

I have the following controller:

data ReplySource = ReplySourceCard { cardId :: Id Card } | ReplySourceInbox
    deriving (Eq, Show, Data)

data ReplyController
    = NewReplyAction { cardUpdateId :: Id CardUpdate, replySource :: ReplySource }
    | CreateReplyAction { cardUpdateId :: Id CardUpdate, replySource :: ReplySource }
    | EditReplyAction { replySource :: ReplySource, replyId :: !(Id Reply) }
    | UpdateReplyAction { replySource :: ReplySource, replyId :: !(Id Reply) }
    | DeleteReplyAction { replySource :: ReplySource, replyId :: !(Id Reply) }
    deriving (Eq, Show, Data)

I also have a view using NewReplyAction: <a href={NewReplyAction (get #id cardUpdate) replySource} ...>.

The generated action looks like this:

http://localhost:8000/NewReply?cardUpdateId=35e54da1-a897-4cda-8193-6856ac214bcb&replySource=ReplySourceCard%7BcardId%3D03462af6-e31d-44fd-a48b-ac253552a8c4

The closing } is missing from ReplySourceCard{cardId=... in the URL. However, even if I add the closing }, I get the following:

Query parameter replySource needs to be a UUID but got ReplySourceCard{cardId=03462af6-e31d-44fd-a48b-ac253552a8c4}
Routing failed with: BadType {expectedType = "UUID", value = Just "ReplySourceCard{cardId=03462af6-e31d-44fd-a48b-ac253552a8c4}", field = "replySource"}

Looks like #763, but #763 is supposed to be fixed.

closed time in 22 days

neongreen

issue commentdigitallyinduced/ihp

AutoRoute fails with certain ADTs as params

AutoRoute works with the following parameter types:

Text, [Text], Maybe Text, Int, [Int], Maybe Int, Id (for all model types)

Oh, alright.

Would be nice if this was typechecked, though.

neongreen

comment created time in 22 days

issue openeddigitallyinduced/ihp

AutoRoute fails with certain ADTs as params

I am using IHP 0.14.

I have the following controller:

data ReplySource = ReplySourceCard { cardId :: Id Card } | ReplySourceInbox
    deriving (Eq, Show, Data)

data ReplyController
    = NewReplyAction { cardUpdateId :: Id CardUpdate, replySource :: ReplySource }
    | CreateReplyAction { cardUpdateId :: Id CardUpdate, replySource :: ReplySource }
    | EditReplyAction { replySource :: ReplySource, replyId :: !(Id Reply) }
    | UpdateReplyAction { replySource :: ReplySource, replyId :: !(Id Reply) }
    | DeleteReplyAction { replySource :: ReplySource, replyId :: !(Id Reply) }
    deriving (Eq, Show, Data)

I also have a view using NewReplyAction: <a href={NewReplyAction (get #id cardUpdate) replySource} ...>.

The generated action looks like this:

http://localhost:8000/NewReply?cardUpdateId=35e54da1-a897-4cda-8193-6856ac214bcb&replySource=ReplySourceCard%7BcardId%3D03462af6-e31d-44fd-a48b-ac253552a8c4

The closing } is missing from ReplySourceCard{cardId=... in the URL. However, even if I add the closing }, I get the following:

Query parameter replySource needs to be a UUID but got ReplySourceCard{cardId=03462af6-e31d-44fd-a48b-ac253552a8c4}
Routing failed with: BadType {expectedType = "UUID", value = Just "ReplySourceCard{cardId=03462af6-e31d-44fd-a48b-ac253552a8c4}", field = "replySource"}

Looks like #763, but #763 is supposed to be fixed.

created time in 22 days

issue commentLeelaChessZero/lc0

MacOS, brew install issues

FWIW it's not obvious how to get a network at all. The two networks recommended at https://lczero.org/play/networks/bestnets/ are more than a year old.

nguyenpham

comment created time in a month

issue commentLeelaChessZero/lc0

MacOS, brew install issues

The homebrew package includes ... network 42850

Can confirm, there doesn't seem to be a network anywhere so at least this part of the manual is wrong.

nguyenpham

comment created time in a month

issue openedckeditor/ckeditor5

Checkboxes and list bullets are too close to left-aligned images

📝 Provide detailed reproduction steps (if any)

Create a left-aligned word-wrapped image and add a list or todo-list to the right (you can use of the demos here or a custom build):

image

image

📃 Other details

  • Browser: Chrome
  • OS: macOS

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

created time in 2 months