ProductPromotion
Logo

Clojure

made by https://0x3d.site

GitHub - missingfaktor/akar: First-class patterns for Clojure. Made with love, functions, and just the right amount of syntax.
First-class patterns for Clojure. Made with love, functions, and just the right amount of syntax. - missingfaktor/akar
Visit Site

GitHub - missingfaktor/akar: First-class patterns for Clojure. Made with love, functions, and just the right amount of syntax.

GitHub - missingfaktor/akar: First-class patterns for Clojure. Made with love, functions, and just the right amount of syntax.

Akar

Clojars Project Clojars Project Clojars Project Clojars Project

[Speech] Queen: Hmm... Who's been painting my roses red? Who's been painting my roses red? Who dares to taint with vulgar paint the royal flower bed? For painting my roses red someone will lose his head. [Spoken] Three: Oh no, your majesty, please, it's all his fault! Two: Not me, Your Grace. The Ace! The Ace! Queen: You? Ace: No, Two! Queen: The Deuce, you say? Two: Not me, the Tres! Queen: That's enough! Off with their heads!

Akar is a pattern matching library for Clojure, with focus on simplicity and abstraction.

Akar patterns are first-class values (just functions, actually), that can be manipulated, composed, abstracted over, like any other values. In fact, this is exactly how various pattern operations, such as guards, alternation, and views are implemented in Akar.

The library also features a syntactic layer that makes common use cases convenient, but at the same time stays true to the first-class spirit of the core model.

Akar (IPA: [ɑkɑɾ], Devanagari: आकार) is a Sanskrit/Marathi word for shape. The logo is a Saraswati Kolam, a diagrammatic representation of Hindu goddess of wisdom.

To learn more, read the Akar tutorial and FAQs.

Releases and Dependency Information

# Specific Akar projects
[akar/akar-core "3.0.0"]

# All Akar projects
[akar "3.0.0"]

Example

(ns your.app
  (:require [akar.syntax :refer [match]]
            [clojure.data.xml :as xml]))

; Example borrowed from https://wiki.scala-lang.org/display/SYGN/Xml-pattern-matching
(defn italics [xml-node]
  (match xml-node
         {:tag :i :content (:seq [contents])} (println contents)
         {:tag :node :content nodes}          (doseq [child nodes] (italics child))
         :_                                   nil))

(def xml-doc
  (xml/parse (java.io.StringReader.
               "<node>
                  <node>This is <i>some</i> text content.
                    <node>This is <i>deeper</i> stuff.</node>
                  </node>
                  <node>I am some text.
                    <title>I am <i>a title</i>.</title>
                    This is a sentence with an <i>italicized</i> entry.
                  </node>
                </node>")))

(italics xml-doc)

; prints:
;   some
;   deeper
;   italicized

Contributing

Do you wish to contribute to Akar? Splendid! Get started here.

License

Copyright © 2024 Rahul Goma Phulore

Distributed under Apache License 2.0.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory