diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..bbd3613 --- /dev/null +++ b/LICENSE @@ -0,0 +1,31 @@ +Copyright (c) 2010 Roel van Dijk + +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + * The name of Roel van Dijk and the names of contributors may NOT + be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/haskell-unicode-input-method.el b/haskell-unicode-input-method.el new file mode 100644 index 0000000..0a49455 --- /dev/null +++ b/haskell-unicode-input-method.el @@ -0,0 +1,193 @@ +;; Haskell Unicode helper functions +;; Copyright: 2010 Roel van Dijk +;; License: BSD3, see the accompanying file LICENSE. + +(require 'quail) + +(quail-define-package + "haskell-unicode" "UTF-8" "\\" t + "Haskell Unicode input method. +Designed to be used with the Haskell UnicodeSyntax language +extension in combination with the x-unicode-symbols set of +packages (base-unicode-symbols and containers-unicode-symbols). +" nil t nil nil nil nil nil nil nil nil t) + +(quail-define-rules + ;; Greek letters + ("alpha" ?α) + ("Alpha" ?Α) + ("beta" ?β) + ("Beta" ?Β) + ("gamma" ?γ) + ("Gamma" ?Γ) + ("delta" ?δ) + ("Delta" ?Δ) + ("epsilon" ?ε) + ("Epsilon" ?Ε) + ("zeta" ?ζ) + ("Zeta" ?Ζ) + ("eta" ?η) + ("Eta" ?Η) + ("theta" ?θ) + ("Theta" ?Θ) + ("iota" ?ι) + ("Iota" ?Ι) + ("kappa" ?κ) + ("Kappa" ?Κ) + ("lambda" ?λ) + ("Lambda" ?Λ) + ("lamda" ?λ) + ("Lamda" ?Λ) + ("mu" ?μ) + ("Mu" ?Μ) + ("nu" ?ν) + ("Nu" ?Ν) + ("xi" ?ξ) + ("Xi" ?Ξ) + ("omicron" ?ο) + ("Omicron" ?Ο) + ("pi" ?π) + ("Pi" ?Π) + ("rho" ?ρ) + ("Rho" ?Ρ) + ("sigma" ?σ) + ("Sigma" ?Σ) + ("tau" ?τ) + ("Tau" ?Τ) + ("upsilon" ?υ) + ("Upsilon" ?Υ) + ("phi" ?φ) + ("Phi" ?Φ) + ("chi" ?χ) + ("Chi" ?Χ) + ("psi" ?ψ) + ("Psi" ?Ψ) + ("omega" ?ω) + ("Omega" ?Ω) + ("digamma" ?ϝ) + ("Digamma" ?Ϝ) + ("san" ?ϻ) + ("San" ?Ϻ) + ("qoppa" ?ϙ) + ("Qoppa" ?Ϙ) + ("sampi" ?ϡ) + ("Sampi" ?Ϡ) + ("stigma" ?ϛ) + ("Stigma" ?Ϛ) + ("heta" ?ͱ) + ("Heta" ?Ͱ) + ("sho" ?ϸ) + ("Sho" ?Ϸ) + + ;; Types + ("::" ?∷) + + ;; Quantifiers + ("forall" ?∀) + ("exists" ?∃) + + ;; Arrows + ("->" ?→) + ("-->" ?⟶) + ("<-" ?←) + ("<--" ?⟵) + ("<->" ?↔) + ("<-->" ?⟷) + + ("=>" ?⇒) + ("==>" ?⟹) + ("<=" ?⇐) + ("<==" ?⟸) + ("<=>" ?⇔) + ("<==>" ?⟺) + + ("|->" ?↦) + ("|-->" ?⟼) + ("<-|" ?↤) + ("<--|" ?⟻) + + ("|=>" ?⤇) + ("|==>" ?⟾) + ("<=|" ?⤆) + ("<==|" ?⟽) + + ("~>" ?⇝) + ("~~>" ?⟿) + ("<~" ?⇜) + ("<~~" ?⬳) + + (">->" ?↣) + ("<-<" ?↢) + ("->>" ?↠) + ("<<-" ?↞) + + (">->>" ?⤖) + ("<<-<" ?⬻) + + ("<|-" ?⇽) + ("-|>" ?⇾) + ("<|-|>" ?⇿) + + ("<-/-" ?↚) + ("-/->" ?↛) + + ("<-|-" ?⇷) + ("-|->" ?⇸) + ("<-|->" ?⇹) + + ("<-||-" ?⇺) + ("-||->" ?⇻) + ("<-||->" ?⇼) + + ("-o->" ?⇴) + ("<-o-" ?⬰) + + ;; Boolean operators + ("not" ?¬) + ("&&" ?∧) + ("||" ?∨) + + ;; Relational operators + ("==" ?≡) + ("/=" ?≢) + ("<=" ?≤) + (">=" ?≥) + ("/<" ?≮) + ("/>" ?≯) + + ;; Arithmetic + ("/" ?÷) + ("*" ?⋅) + + ;; Containers / Collections + ("++" ?⧺) + ("+++" ?⧻) + ("|||" ?⫴) + ("empty" ?∅) + ("elem" ?∈) + ("notElem" ?∉) + ("member" ?∈) + ("notMember" ?∉) + ("union" ?∪) + ("intersection" ?∩) + ("isSubsetOf" ?⊆) + ("isProperSubsetOf" ?⊂) + + ;; Other + ("<<" ?≪) + (">>" ?≫) + ("<<<" ?⋘) + (">>>" ?⋙) + ("<|" ?⊲) + ("|>" ?⊳) + ("><" ?⋈) + ("mempty" ?∅) + ("mappend" ?⊕) + ("<*>" ?⊛) + ("." ?∘) + ("undefined" ?⊥) + (":=" ?≔) + ("=:" ?≕) + ("=def" ?≝) + ("=?" ?≟) +)