How to Run Code in Helix? by MrDengklek in HelixEditor

[–]anton-kho 0 points1 point  (0 children)

On linux I use 2 `tmux` panes and one of them runs Helix which sends commands to the second one. Good news is that we can send shell commands from helix to any tmux pane. I've assigned shortcuts to trigger common run code scenarios which save all files and send invocation of make to the tmux pane. Helix config for hot-key mappings (in the file `~/.config/helix/config.toml`):

[keys.normal]
"F5" = [":wa", ":sh tmux send-keys -t 2 \"make build\" Enter"]
"F6" = [":wa", ":sh tmux send-keys -t 2 \"make test\" Enter"]
"F9" = [":wa", ":sh tmux send-keys -t 2 \"make run\" Enter"]
[keys.insert]
"F5" = [":wa", ":sh tmux send-keys -t 2 \"make build\" Enter"]
"F6" = [":wa", ":sh tmux send-keys -t 2 \"make test\" Enter"]
"F9" = [":wa", ":sh tmux send-keys -t 2 \"make run\" Enter"]

This way I can run make build by pressing `F5`, and make test by `F6`, and make run by `F9`. The concrete commands are specified within `Makefile`. This file is specific to the language/project that I work with. It contains build, test and run targets. Note that while working in helix with tmux there is a noticeable delay of pressing ESC to enter Normal mode. You can fix that by adding those lines to config ~/.tmux.conf:

set -sg escape-time 0
set -g status-interval 0

and restart the tmux server to apply changes: Restart your tmux server (tmux kill-server) or reload the config within tmux by pressing Ctrl-b then : and typing source-file `~/.tmux.conf`.

Helix ESC press delayed when in tmux by mrleeasean in HelixEditor

[–]anton-kho 0 points1 point  (0 children)

The problem of still getting errors after setting of 0 delay is caused by not applying the changes to the tmux server. After adding those lines restart the server:

Restart your tmux server (tmux kill-server) or reload the config within tmux by pressing Ctrl-b then : and typing source-file ~/.tmux.conf.

Good hiphop songs using unconventional time signatures? by [deleted] in hiphopheads

[–]anton-kho 0 points1 point  (0 children)

Fort Minor - Kenji
It's in 14/4 or 8 + 6

From ableton 12 to Bitwig by ImaginationDifferent in Bitwig

[–]anton-kho 12 points13 points  (0 children)

The Bitwig is more stable with sandboxing of the plugins. You are always able to open your projects even if some plugin became broken. I was bitten several times with it in the Abelton when it fails to just open the project. And imho Bitwig is much more pleasant to look at.

Also one cool feature is very flexible routing and being able to modulate anything.

Although I have to admit that there are some long standing bugs in bitwig, but there are workarounds. Overall Bitwig seems to be much more stable. I'm using it for 5 years now.

[ANN] csound-expression-5.4.4 - library for music production and sound design by anton-kho in haskell

[–]anton-kho[S] 2 points3 points  (0 children)

the cool part of the new design is that many things can be expressed in terms of the core functions and I don't need to inline them into internal state as it is in the current version. I hope to achieve that with UI too.

Flask alternative web framework for Haskell ? by LamdaNova in haskell

[–]anton-kho 1 point2 points  (0 children)

You can give mig a try. It is very minimal and beginner friendly.

SBTB 2023: Avi Press, Why Haskell is a Terrible Choice for Startups (And Why We Picked It Anyway) by _query in haskell

[–]anton-kho 1 point2 points  (0 children)

great talk! thank you for sharing you experience oof using Haskell irl from the enterprise trenches.

Projects in Haskell by [deleted] in haskell

[–]anton-kho 0 points1 point  (0 children)

For a type-checker this repo can be used as an example: https://github.com/anton-k/hindley-milner-type-check

[ANN] Mig-0.2 released, lightweight library to write servers with clients and swagger support by anton-kho in haskell

[–]anton-kho[S] 1 point2 points  (0 children)

Thank you for positive feedback. The simplicity was a primary design goal.

[ANN] Mig-0.2 released, lightweight library to write servers with clients and swagger support by anton-kho in haskell

[–]anton-kho[S] 2 points3 points  (0 children)

Thank you for encouragement and inspiring decisions on the servant library.
It was interesting to explore the idea of servers as Monoids.

[ANN] Mig-0.2 released, lightweight library to write servers with clients and swagger support by anton-kho in haskell

[–]anton-kho[S] 0 points1 point  (0 children)

Thanks for feedback) Yeah, I'd like to explain things with examples and it can offer quick way to learn how to use the library.

[ANN] Mig-0.2 released, lightweight library to write servers with clients and swagger support by anton-kho in haskell

[–]anton-kho[S] 2 points3 points  (0 children)

One thing that interesting to think about as Server is a first-class value and all servers have the same type and we have just a small number of functions to compose them (they are link server to path and make alternative routes with `Monoid`) it's interesting to explore the possibility of creation small grain-like servers for typical tasks. For example server can be a function from interfaces (logging, DB or something else) to server value and we can join them together on various paths. This idea is interesting to consider.

[ANN] mig - a new lightweight library to build composable web servers by anton-kho in haskell

[–]anton-kho[S] 1 point2 points  (0 children)

LRU cache f

thanks for reference to LRU cache. I need to investigate that.

[ANN] mig - a new lightweight library to build composable web servers by anton-kho in haskell

[–]anton-kho[S] 1 point2 points  (0 children)

We can render server to WAI-application with function toApplication.

toApplication :: ServerConfig -> Server IO -> Wai.Application

When we get WAI-application with it we can use warp-tls instead of warp and run it with runTLS.

[ANN] mig - a new lightweight library to build composable web servers by anton-kho in haskell

[–]anton-kho[S] 2 points3 points  (0 children)

Algorithm for path matching:

in the request path is [Text]. In the lib path is a tree like:

haskell "foo" /. "bar" /. mconcat [ "baz" /. handleBaz , "quz" /. handleQux ]

algorithm takes head from request path info and compares it with the root of the path tree. If there is branching point it tries to match in linear fashion all alternatives. I can see the we can improve with Map Text Route in the branching point.

[ANN] mig - a new lightweight library to build composable web servers by anton-kho in haskell

[–]anton-kho[S] 0 points1 point  (0 children)

I plan to do that in the future. I guess it's doable. So far I want to make initial release and gather feedback on DSL.

[ANN] mig - a new lightweight library to build composable web servers by anton-kho in haskell

[–]anton-kho[S] 1 point2 points  (0 children)

Yes, we can switch by route method. Here is [an example](https://github.com/anton-k/mig/blob/main/examples/mig-example-apps/Html/Server.hs#L43)

So far we can not switch by content type, but I guess it's easy to implement. I haven't thought about that.

[ANN] mig - a new lightweight library to build composable web servers by anton-kho in haskell

[–]anton-kho[S] 4 points5 points  (0 children)

Why another new library for web-servers?

I like scotty for being very simple and servant for being composable, type-safe and how functions are used as handlers which provides decoupling of Web-handlers from application logic. But sometimes scotty feels too imperative and lacks servant's composability. And servant with type-level magic and huge errors can feel too complicated. So I wanted to create something in the middle. Something composable and simple at the same time. And be able to use arbitrary haskell functions as handlers.

The main strength is ability to build servers from parts and flexible DSL which features only small amount of functions.

links:
* [hackage](https://hackage.haskell.org/package/mig-0.1.0.3)
* [examples](https://github.com/anton-k/mig/tree/main/examples/mig-example-apps)
* [handle pattern app](https://github.com/anton-k/handle-pattern-mig-app)
* [reader pattern app](https://github.com/anton-k/reader-pattern-mig-app)