Skip to content
swr1bm86Public

About

ADT support for Clojure

Topics

Resources

Stars

3 stars

Watchers

2 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ADT

Algebraic Data Type

Build Status

Installation

Clojars Project

Usage

:dependencies [[zjhmale/adt "0.1.0"]]

Examples

(require [adt.sweet :refer :all])

(defadt ::tree
  Empty-tree
  (Leaf value)
  (Node left-tree value right-tree))

(defn depth
  [t]
  (match t
    Empty-tree 0
    (Leaf _) 1
    (Node l v r) (inc (max (depth l) (depth r)))))

License

Copyright © 2010 Rich Hickey and the various contributors

Distributed under the Eclipse Public License, the same as Clojure.

About

ADT support for Clojure

Topics

Resources

Stars

3 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages