_id stringlengths 64 64 | repository stringlengths 6 84 | name stringlengths 4 110 | content stringlengths 0 248k | license null | download_url stringlengths 89 454 | language stringclasses 7
values | comments stringlengths 0 74.6k | code stringlengths 0 248k |
|---|---|---|---|---|---|---|---|---|
c6101ad483335f42d943b526ab83f3d55df0832d298df92967fbd580f1410add | AccelerateHS/accelerate-llvm | Type.hs | {-# LANGUAGE GADTs #-}
{-# OPTIONS_HADDOCK hide #-}
-- |
-- Module : Data.Array.Accelerate.LLVM.CodeGen.Type
Copyright : [ 2015 .. 2020 ] The Accelerate Team
-- License : BSD3
--
Maintainer : < >
-- Stability : experimental
Portability : non - portable ( GHC extensions )
--
module Data.Array.... | null | https://raw.githubusercontent.com/AccelerateHS/accelerate-llvm/cf081587fecec23a19f68bfbd31334166868405e/accelerate-llvm/src/Data/Array/Accelerate/LLVM/CodeGen/Type.hs | haskell | # LANGUAGE GADTs #
# OPTIONS_HADDOCK hide #
|
Module : Data.Array.Accelerate.LLVM.CodeGen.Type
License : BSD3
Stability : experimental
| Extract some evidence that a reified type implies that type is a valid
element
| Copyright : [ 2015 .. 2020 ] The Accelerate Team
Maintainer : < >
Portability : non - portable ( GHC extensions )
module Data.Array.Accelerate.LLVM.CodeGen.Type
where
import LLVM.AST.Type.Representation
import Data.Array.Accelerate.Sugar.Elt
import Data.Constraint
singleElt :: SingleType a -> Dict... |
2113013a099ec812f7b85bf654d40d2637c358d1db0a20ed4bc85685191b88f8 | LeventErkok/sbv | SMTLib.hs | -----------------------------------------------------------------------------
-- |
Module : Data . SBV.SMT.SMTLib
Copyright : ( c )
-- License : BSD3
-- Maintainer:
-- Stability : experimental
--
Conversion of symbolic programs to SMTLib format
------------------------------------------------------------... | null | https://raw.githubusercontent.com/LeventErkok/sbv/cfaa40b8c8ff8e1b7ff9ab71304654f6f531ba72/Data/SBV/SMT/SMTLib.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD3
Maintainer:
Stability : experimental
---------------------------------------------------------------------------
# OPTIONS_GHC -Wall -Werror #
| Convert to SMTLib-2 format
| Convert to SMTLib-2 format | Module : Data . SBV.SMT.SMTLib
Copyright : ( c )
Conversion of symbolic programs to SMTLib format
# LANGUAGE NamedFieldPuns #
module Data.SBV.SMT.SMTLib (
SMTLibPgm
, toSMTLib
, toIncSMTLib
) where
import qualified Data.Set as Set (member, toList)
import Data.SBV.Core.... |
731f9b34250165b448c66bd54162e88ebd254d6f91e93c37d0e8e13c6f6e85d1 | UnixJunkie/cpmlib | myList.ml |
include BatList
(* count elements of [l] satisfying [p] *)
let filter_count p l =
fold_left (fun acc x ->
if p x then acc + 1
else acc
) 0 l
split [ l ] in two parts ,
the first one being the longest prefix of [ l ] where [ p ] holds
the first one being the longest prefix of [l] where [p]... | null | https://raw.githubusercontent.com/UnixJunkie/cpmlib/37e81c82448ecea6e651d05d0af892a9d7688ed8/src/myList.ml | ocaml | count elements of [l] satisfying [p] |
include BatList
let filter_count p l =
fold_left (fun acc x ->
if p x then acc + 1
else acc
) 0 l
split [ l ] in two parts ,
the first one being the longest prefix of [ l ] where [ p ] holds
the first one being the longest prefix of [l] where [p] holds *)
let partition_while p l =
let r... |
83c900d9904fde8b4cba0fe8c4d516efb9fc7fe0e6acc6fd866ec048898d44cd | Relph1119/sicp-solutions-manual | p48-average-damp.scm | (load "src/examples/ch01/p15-average.scm")
(define (average-damp f)
(lambda (x) (average x (f x)))) | null | https://raw.githubusercontent.com/Relph1119/sicp-solutions-manual/f2ff309a6c898376209c198030c70d6adfac1fc1/src/examples/ch01/p48-average-damp.scm | scheme | (load "src/examples/ch01/p15-average.scm")
(define (average-damp f)
(lambda (x) (average x (f x)))) | |
e68878e18106b7da66cf642ae1761218cd087d09f88185074cc2a55d1c1ce53f | let-def/lwd | main.ml | Js_of_ocaml examples
* /
* Copyright ( C ) 2008
*
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
* TERMS AND CONDITIONS FOR COPYING , DISTRIBUTION AND MODIFICATION
*
* /
* Copyright (C) 2008 Benjamin Canou
*
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
* TERMS AND C... | null | https://raw.githubusercontent.com/let-def/lwd/d367a72312af1e900952742f7252c409ee3d6ecb/examples/minesweeper-tyxml/main.ml | ocaml | let root = Lwd.observe (Lwdom.to_fragment doc) in | Js_of_ocaml examples
* /
* Copyright ( C ) 2008
*
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
* TERMS AND CONDITIONS FOR COPYING , DISTRIBUTION AND MODIFICATION
*
* /
* Copyright (C) 2008 Benjamin Canou
*
* DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
* TERMS AND C... |
62a88e148d2334b5ea75b7a7e90bf4f27e15df4b15f58c4fb85b6aa9e1a11a8b | maybevoid/casimir | Handler.hs |
module Casimir.Free.Handler
( withCoOpHandler
, withCoOpHandlerAndOps
, withContextualCoOpHandler
)
where
import Casimir.Base
import Casimir.Free.FreeEff
import Casimir.Free.FreeOps
# INLINE withCoOpHandler #
withCoOpHandler
:: forall free handler eff a r
. ( Effect eff
, EffOps handler
, Fre... | null | https://raw.githubusercontent.com/maybevoid/casimir/ebbfa403739d6f258e6ac6793549006a0e8bff42/casimir/src/lib/Casimir/Free/Handler.hs | haskell |
module Casimir.Free.Handler
( withCoOpHandler
, withCoOpHandlerAndOps
, withContextualCoOpHandler
)
where
import Casimir.Base
import Casimir.Free.FreeEff
import Casimir.Free.FreeOps
# INLINE withCoOpHandler #
withCoOpHandler
:: forall free handler eff a r
. ( Effect eff
, EffOps handler
, Fre... | |
b5b7556d4b719200c86eaff37794a24ecec06756e389e8b217a4cec928d5aa38 | darklang/philip2 | Json_encode_extended.mli | include (module type of Json.Encode)
val variant : string -> Js.Json.t list -> Js.Json.t
| null | https://raw.githubusercontent.com/darklang/philip2/1ab29b8f40d64b40cf7f3ad77e145358b905dbd7/useful_ocaml/Json_encode_extended.mli | ocaml | include (module type of Json.Encode)
val variant : string -> Js.Json.t list -> Js.Json.t
| |
892273dc2aa758bee7a8f7a2199ad5d78712cacc3753b16486860f94b5e06185 | project-oak/hafnium-verification | PolyVariantEqual.ml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/istd/PolyVariantEqual.ml | ocaml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | |
0d511fbee9eda4de28f791036d33e043383931ae08a09b1b9b7309e285b94a3b | Clojure2D/clojure2d-examples | aabb.clj | (ns rt4.the-next-week.ch04a.aabb
(:require [rt4.the-next-week.ch04a.interval :as interval]
[fastmath.vector :as v]
[fastmath.core :as m])
(:import [fastmath.vector Vec3]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(m/use-primitive-operators)
(defprotocol AABBP... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/ead92d6f17744b91070e6308157364ad4eab8a1b/src/rt4/the_next_week/ch04a/aabb.clj | clojure | (ns rt4.the-next-week.ch04a.aabb
(:require [rt4.the-next-week.ch04a.interval :as interval]
[fastmath.vector :as v]
[fastmath.core :as m])
(:import [fastmath.vector Vec3]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(m/use-primitive-operators)
(defprotocol AABBP... | |
9eb8d6e7f324ea4ff70ee024b042aa374e949df65677c94fb72b36ba4bd5c714 | nasa/Common-Metadata-Repository | acl_service.clj | (ns cmr.search.services.acl-service
"Performs ACL related tasks for the search application"
(:require
[cmr.common.api.context :as context-util]
[cmr.common.concepts :as cc]
[cmr.search.services.acls.acl-helper :as acl-helper]
[cmr.transmit.config :as tc]))
(defmulti acls-match-concept?
"Returns true ... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/ce988fe5bab5d2df5648b2fac79def05786c75a6/search-app/src/cmr/search/services/acl_service.clj | clojure |
See also:
* +Improved+CMR+Concept+Creation
* +Concept+Creation+API
This code is a point of contention for adding new concepts: on both
occasions where we added varible and service support (e.g. to the
`/search/concepts` route), tests failed with ACL errors due to this ns
not get... | (ns cmr.search.services.acl-service
"Performs ACL related tasks for the search application"
(:require
[cmr.common.api.context :as context-util]
[cmr.common.concepts :as cc]
[cmr.search.services.acls.acl-helper :as acl-helper]
[cmr.transmit.config :as tc]))
(defmulti acls-match-concept?
"Returns true ... |
0557772966d9ba89c3552dccbb0fb5e1d2474ca30375be72269a8ff105da3a31 | adomokos/haskell-katas | Ex47_FaNewTypeMonoidSpec.hs | # LANGUAGE GeneralizedNewtypeDeriving #
module Solutions.Ex47_FaNewTypeMonoidSpec
( spec
) where
import Data.Monoid
import Test.Hspec
main :: IO ()
main = hspec spec
newtype AInt = A
{ unA :: Int
} deriving (Show, Eq, Num)
instance Semigroup AInt where
(<>) = (+)
-- monoid under addition
instance Monoid... | null | https://raw.githubusercontent.com/adomokos/haskell-katas/be06d23192e6aca4297814455247fc74814ccbf1/test/Solutions/Ex47_FaNewTypeMonoidSpec.hs | haskell | monoid under addition
monoid under addition | # LANGUAGE GeneralizedNewtypeDeriving #
module Solutions.Ex47_FaNewTypeMonoidSpec
( spec
) where
import Data.Monoid
import Test.Hspec
main :: IO ()
main = hspec spec
newtype AInt = A
{ unA :: Int
} deriving (Show, Eq, Num)
instance Semigroup AInt where
(<>) = (+)
instance Monoid AInt where
mempty = 0
... |
32fb0178aef7924e9bf6e49af762463804ccd2edaf5f9cf0c05264d242051f5e | graninas/Andromeda | TestCommon.hs | module Test.Simulator.TestCommon where
import Andromeda.Assets.SpaceshipSample
import Andromeda.Simulator
makeRunningSimulation = do
simModel <- compileSimModel networkDef
pipe <- createPipe :: IO SimulatorPipe
simHandle <- startSimulation pipe process simModel
return (pipe, simHandle)
simulateSingleReq req ... | null | https://raw.githubusercontent.com/graninas/Andromeda/6b56052bca64fc6f55a28f8001dd775a744b95bf/trash/TestCommon.hs | haskell | module Test.Simulator.TestCommon where
import Andromeda.Assets.SpaceshipSample
import Andromeda.Simulator
makeRunningSimulation = do
simModel <- compileSimModel networkDef
pipe <- createPipe :: IO SimulatorPipe
simHandle <- startSimulation pipe process simModel
return (pipe, simHandle)
simulateSingleReq req ... | |
f1c48d7b38dca3b9590422d60734b641d8f8cf40a348be59386c285e0d02ed64 | essiene/smpp34 | hello_esme.erl | -module(hello_esme).
-include_lib("smpp34pdu/include/smpp34pdu.hrl").
-behaviour(gen_esme34).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
handle_rx/2, handle_tx/3, terminate/2, code_change/3]).
-export([start/0, start/3, stop/0, sendsms/3, ping/0]).
-record(state, {host, port, system_id, pa... | null | https://raw.githubusercontent.com/essiene/smpp34/9206b1d270dc77d65a64a539cbca41b8b003956a/examples/hello_esme.erl | erlang | -module(hello_esme).
-include_lib("smpp34pdu/include/smpp34pdu.hrl").
-behaviour(gen_esme34).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
handle_rx/2, handle_tx/3, terminate/2, code_change/3]).
-export([start/0, start/3, stop/0, sendsms/3, ping/0]).
-record(state, {host, port, system_id, pa... | |
d8c7eb188a5dfbc4dfa58a9a6be25f62fd7057249ceebe68e7dc5250932880c4 | JohannesFKnauf/parti-time | time_test.clj | (ns parti-time.util.time-test
(:import [java.time LocalDateTime ZoneId])
(:require [clojure.test :as t]
[parti-time.util.time :as sut]))
(defn set-timezone [f]
(with-redefs [sut/default-zoneid (ZoneId/of "Europe/Berlin")]
(f)))
(t/use-fixtures :once set-timezone)
(t/deftest time-parsing
(t/is... | null | https://raw.githubusercontent.com/JohannesFKnauf/parti-time/ee85944e7ba201c4a46be152b09b2f7c591c0389/src/test/clj/parti_time/util/time_test.clj | clojure | (ns parti-time.util.time-test
(:import [java.time LocalDateTime ZoneId])
(:require [clojure.test :as t]
[parti-time.util.time :as sut]))
(defn set-timezone [f]
(with-redefs [sut/default-zoneid (ZoneId/of "Europe/Berlin")]
(f)))
(t/use-fixtures :once set-timezone)
(t/deftest time-parsing
(t/is... | |
22f6895471289b73da0d9046c4cbcabbd9ecfc8fc87a89750477c887386f009c | roman01la/cljs-rum-realworld-example-app | profile.cljs | (ns conduit.controllers.profile)
(def initial-state
{})
(defmulti control (fn [event] event))
(defmethod control :default [_ _ state]
{:state state})
(defmethod control :init []
{:state initial-state})
(defmethod control :load [_ _ state]
{:state state})
(defmethod control :follow [_ [id token callback]]
... | null | https://raw.githubusercontent.com/roman01la/cljs-rum-realworld-example-app/962695bd391806a7066340461c3e02f2215fdc48/src/conduit/controllers/profile.cljs | clojure | (ns conduit.controllers.profile)
(def initial-state
{})
(defmulti control (fn [event] event))
(defmethod control :default [_ _ state]
{:state state})
(defmethod control :init []
{:state initial-state})
(defmethod control :load [_ _ state]
{:state state})
(defmethod control :follow [_ [id token callback]]
... | |
11548f7d917f89a75d34b08320e3cf238c0bda7606d6e3ae2f92aa9512a9f170 | racket/htdp | pad.rkt | #lang racket/gui
;; provide basic elements for game pad clause in big-bang: the icon, pad-event?
(require mrlib/include-bitmap)
(provide
;; bitmap
game-pad
KeyEvent - > Boolean
;; is the given key-event also a pad-event?
pad-event?
;; PadEvent PadEvent -> Boolean
are the two pad - events equal ?
p... | null | https://raw.githubusercontent.com/racket/htdp/aa78794fa1788358d6abd11dad54b3c9f4f5a80b/htdp-lib/2htdp/private/pad.rkt | racket | provide basic elements for game pad clause in big-bang: the icon, pad-event?
bitmap
is the given key-event also a pad-event?
PadEvent PadEvent -> Boolean
--------------------------------------------------------------------------------------------------- | #lang racket/gui
(require mrlib/include-bitmap)
(provide
game-pad
KeyEvent - > Boolean
pad-event?
are the two pad - events equal ?
pad=?
)
(define game-pad (include-bitmap "gamepad.png" 'png/alpha))
(unless (send game-pad ok?)
(error 'big-bang "the game pad icon isn't available; please report error"... |
78e56e107d4d9bf35c5e7c467877375561a198d1b33dd1170665544d76f803e3 | ekmett/physics | V4.hs | {-# LANGUAGE DeriveDataTypeable #-}
module Physics.V4
( V4(..)
, vector, point
, R2(..)
, R3(..)
, R4(..)
) where
import Control.Applicative
import Control.Lens.Rep
import Data.Data
import Data.Foldable
import Data.Monoid
import Data.Traversable
import Physics.Epsilon
import Physics.Metric
import Physics.V... | null | https://raw.githubusercontent.com/ekmett/physics/08a61035594b3023e3306457947a2a5474661af7/Physics/V4.hs | haskell | # LANGUAGE DeriveDataTypeable # | module Physics.V4
( V4(..)
, vector, point
, R2(..)
, R3(..)
, R4(..)
) where
import Control.Applicative
import Control.Lens.Rep
import Data.Data
import Data.Foldable
import Data.Monoid
import Data.Traversable
import Physics.Epsilon
import Physics.Metric
import Physics.V2
import Physics.V3
data V4 a = V4 ... |
2af249cfe30ce675b354cbf88693cb99b0fa61db2e04c6f16e405766b224d0a3 | jixiuf/helloerlang | erlcount_sup.erl | -module(erlcount_sup).
-behaviour(supervisor).
-export([start_link/0,init/1]).
start_link()->
io:format("erlcount_sup is staring... ~n",[]),
supervisor:start_link(?MODULE,[])
.
init([])->
io:format("erlcount_sup is initing...~n",[]),
MaxRestart=3,
MaxTime=5000,
{ok,{{one_for_one,MaxRest... | null | https://raw.githubusercontent.com/jixiuf/helloerlang/3960eb4237b026f98edf35d6064539259a816d58/erlcount/src/erlcount_sup.erl | erlang | id | -module(erlcount_sup).
-behaviour(supervisor).
-export([start_link/0,init/1]).
start_link()->
io:format("erlcount_sup is staring... ~n",[]),
supervisor:start_link(?MODULE,[])
.
init([])->
io:format("erlcount_sup is initing...~n",[]),
MaxRestart=3,
MaxTime=5000,
{ok,{{one_for_one,MaxRest... |
8a227ec8d291a3148926c4f8d8a0600ba689dfa1f758ad5eced2e8aa2b669a15 | rescript-lang/rescript-compiler | lam_coercion.ml | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
* Copyright ( C ) 2017 - , Authors of ReScript
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/e60482c6f6a69994907b9bd56e58ce87052e3659/jscomp/core/lam_coercion.ml | ocaml | let export/100 =a export/99
above is probably the cause but does not have to be
* not used in code generation, mostly used
for store some information in cmj files
all code to be compiled later = original code + rebound coercions
relies on the Invariant that [eoid] can not be bound before
F... | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
* Copyright ( C ) 2017 - , Authors of ReScript
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the... |
2f583a9dba5da02ed10689217a18089479fc1cb4453d1c22fdaa6c6bd086eec1 | kupl/LearnML | original.ml | type formula =
| True
| False
| Not of formula
| AndAlso of (formula * formula)
| OrElse of (formula * formula)
| Imply of (formula * formula)
| Equal of (exp * exp)
and exp = Num of int | Plus of (exp * exp) | Minus of (exp * exp)
let rec cal (exp : exp) : int =
match exp with
| Num x -> x
| Plus... | null | https://raw.githubusercontent.com/kupl/LearnML/c98ef2b95ef67e657b8158a2c504330e9cfb7700/result/cafe2/formula/sub11/original.ml | ocaml | type formula =
| True
| False
| Not of formula
| AndAlso of (formula * formula)
| OrElse of (formula * formula)
| Imply of (formula * formula)
| Equal of (exp * exp)
and exp = Num of int | Plus of (exp * exp) | Minus of (exp * exp)
let rec cal (exp : exp) : int =
match exp with
| Num x -> x
| Plus... | |
708f1c217cbc4aef83f429fe0418e9a9d7d9170a6c19c40aac1ac90a32888ca9 | fukamachi/websocket-driver | echo-server.lisp | (ql:quickload '(:websocket-driver :clack) :silent t)
(in-package :cl-user)
(defpackage websocket-test
(:use :cl
:websocket-driver))
(in-package :websocket-test)
(defparameter *handler*
(intern (string-upcase (or (asdf::getenv "CLACK_HANDLER") "hunchentoot")) :keyword))
(defvar *app*
(lambda (env)
(... | null | https://raw.githubusercontent.com/fukamachi/websocket-driver/2d20d81f5257111426873b9879795827e4625b83/examples/echo-server.lisp | lisp |
}; | (ql:quickload '(:websocket-driver :clack) :silent t)
(in-package :cl-user)
(defpackage websocket-test
(:use :cl
:websocket-driver))
(in-package :websocket-test)
(defparameter *handler*
(intern (string-upcase (or (asdf::getenv "CLACK_HANDLER") "hunchentoot")) :keyword))
(defvar *app*
(lambda (env)
(... |
1c4c6b1dbcdda11021c78978c7f050d8db0c548d67fce5de5c55cdb433119435 | smimram/ocaml-pandoc | abbreviations.ml | * Ensure that abbreviations are followed by non - breakable spaces . Pandoc
already does that , but it does not play well with other plugins such as
include , and abbreviations followed by code are not handled .
already does that, but it does not play well with other plugins such as
include, and abb... | null | https://raw.githubusercontent.com/smimram/ocaml-pandoc/215ba40cb6b5aa67b6f14cdca0138bf055c6a53c/examples/abbreviations.ml | ocaml | * Ensure that abbreviations are followed by non - breakable spaces . Pandoc
already does that , but it does not play well with other plugins such as
include , and abbreviations followed by code are not handled .
already does that, but it does not play well with other plugins such as
include, and abb... | |
dacbfec3e53e9ae99fd4e2c0257633f88b6bd006dfea5d134485aef463bbcc4f | stylewarning/deprecated-coalton-prototype | node.lisp | node.lisp
;;;; A representation of a value.
(in-package #:coalton-impl)
Types are fully defined in
(defstruct (ty (:constructor nil)))
(defun type-list-p (thing)
(and (alexandria:proper-list-p thing)
(every (lambda (x) (typep x 'ty)) thing)))
(deftype type-list ()
'(satisfies type-list-p))
(defstr... | null | https://raw.githubusercontent.com/stylewarning/deprecated-coalton-prototype/4a42ffb4222fde3abfd1b50d96e455ff2eef9fe8/src/node.lisp | lisp | A representation of a value.
The types of nodes ;;;;;;;;;;;;;;;;;;;;;;;;;
TODO: Multiple bindings!
; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
Patterns
Clauses
The match node
; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; | node.lisp
(in-package #:coalton-impl)
Types are fully defined in
(defstruct (ty (:constructor nil)))
(defun type-list-p (thing)
(and (alexandria:proper-list-p thing)
(every (lambda (x) (typep x 'ty)) thing)))
(deftype type-list ()
'(satisfies type-list-p))
(defstruct (node (:constructor nil))
(d... |
b05c2cae45aa1e67f01da964cd80f9cde32b1ff5a48f8c3193c0ed5b4f00076f | naoiwata/sicp | q2.24.scm | ;; @author naoiwata
SICP Chapter2
question 2.24
( list 1 ( list 2 ( list 3 4 ) ) )
; draw on a figure.
; END | null | https://raw.githubusercontent.com/naoiwata/sicp/7314136c5892de402015acfe4b9148a3558b1211/chapter2/q2.24.scm | scheme | @author naoiwata
draw on a figure.
END | SICP Chapter2
question 2.24
( list 1 ( list 2 ( list 3 4 ) ) )
|
5193330245fb51acdd023b0f046567818a46d6e283bea96bde2c8f23f218c137 | tisnik/clojure-examples | main.clj | (ns main)
(require '[clj-time.core :as t])
(require '[clj-time.format :as f])
(require '[clojure.core.matrix :as m])
(require '[clojure.core.matrix.operators :as o])
(defn matrix-tests
[]
(let [M (m/matrix [[1 2 3] [4 5 6] [7 8 9]])
v (m/matrix [1/2 2/3 3/4])]
(m/pm M)
(m/pm v)
... | null | https://raw.githubusercontent.com/tisnik/clojure-examples/984af4a3e20d994b4f4989678ee1330e409fdae3/clojure9-project1/src/main.clj | clojure | (ns main)
(require '[clj-time.core :as t])
(require '[clj-time.format :as f])
(require '[clojure.core.matrix :as m])
(require '[clojure.core.matrix.operators :as o])
(defn matrix-tests
[]
(let [M (m/matrix [[1 2 3] [4 5 6] [7 8 9]])
v (m/matrix [1/2 2/3 3/4])]
(m/pm M)
(m/pm v)
... | |
65da789f988f586c3c6e1de22615d9d707926645f1766ff440c117e601541e6b | tsloughter/kuberl | kuberl_v1_node_selector_requirement.erl | -module(kuberl_v1_node_selector_requirement).
-export([encode/1]).
-export_type([kuberl_v1_node_selector_requirement/0]).
-type kuberl_v1_node_selector_requirement() ::
#{ 'key' := binary(),
'operator' := binary(),
'values' => list()
}.
encode(#{ 'key' := Key,
'operator' := Operator... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1_node_selector_requirement.erl | erlang | -module(kuberl_v1_node_selector_requirement).
-export([encode/1]).
-export_type([kuberl_v1_node_selector_requirement/0]).
-type kuberl_v1_node_selector_requirement() ::
#{ 'key' := binary(),
'operator' := binary(),
'values' => list()
}.
encode(#{ 'key' := Key,
'operator' := Operator... | |
e580b3c90319eecaea420feded8d2cd176cb8ecb765a2f6c4892820cb9460334 | billstclair/truledger | package.lisp | ; -*- mode: lisp -*-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
Truledger package definition
;;;
(cl:defpackage :truledger-tokens
(:use :cl)
(:export
#:$TIME
#:$PRIVKEY
#:$SERVERID
#:$TOKENID
#:$REGFEE
#:$TRANFEE
#:$FEE
#:$PUBKEY
#:$PUBKEYSIG
#:$ASSE... | null | https://raw.githubusercontent.com/billstclair/truledger/1081ac299a098abc622c9b96386c83f6f8ae2551/src/package.lisp | lisp | -*- mode: lisp -*-
ccl.lisp
crypto-api.lisp
Functions implemented by crypto library
Shared functions
locks.lisp
fsdb.lisp
parser.lisp
bcmath.lisp
timestamp.lisp
utilities.lisp, shared.lisp, ccl.lisp
encrypt-note.lisp
client.lisp & server.lisp
server-web.lisp
toplevel.lisp
Loom functions
you may ... |
Truledger package definition
(cl:defpackage :truledger-tokens
(:use :cl)
(:export
#:$TIME
#:$PRIVKEY
#:$SERVERID
#:$TOKENID
#:$REGFEE
#:$TRANFEE
#:$FEE
#:$PUBKEY
#:$PUBKEYSIG
#:$ASSET
#:$SHUTDOWNMSG
#:$STORAGE
#:$STORAGEFEE
#:$FRACTION
#:$ACCOUNT
#:$LAST
#:$REQ... |
b98d6d4ca22962fca7a174799b734f520bde11a8798cfa80cc27ea9e626148ab | input-output-hk/cardano-prelude | Tripping.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# OPTIONS_GHC -fno - warn - orphans #
-- | Helpers for round-trip testing datatypes
module Test.Cardano.Prelude.Tripping (
runTests,
discoverPropArg,
discoverRoundTrip,
discoverRoundTr... | null | https://raw.githubusercontent.com/input-output-hk/cardano-prelude/94b37483937cfb7c07d69a708c950a090bb9670f/cardano-prelude-test/src/Test/Cardano/Prelude/Tripping.hs | haskell | # LANGUAGE OverloadedStrings #
| Helpers for round-trip testing datatypes
| Lifted from `Hedgehog.Internal.TH.discoverPrefix` and tweaked.
This will find top level definitions of type `(a -> Property)` whose
`(a -> Group)` function which passes that `a`-typed argument to all of
the sub-properties, so that they are... | # LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# OPTIONS_GHC -fno - warn - orphans #
module Test.Cardano.Prelude.Tripping (
runTests,
discoverPropArg,
discoverRoundTrip,
discoverRoundTripArg,
roundTripsAesonShow,
roundTripsAesonBuildable,
roundTripsCanonicalJs... |
e1cc5f1cb12404a3e182488021ce8394a1b05e98527096f8818d3664779eefbb | ctford/Idris-Elba-Dev | ErrReverse.hs | # LANGUAGE PatternGuards #
module Idris.ErrReverse where
import Idris.AbsSyntax
import Idris.Core.TT
import Util.Pretty
import Data.List
import Debug.Trace
-- For display purposes, apply any 'error reversal' transformations so that
-- errors will be more readable
errReverse :: IState -> Term -> Term
errReverse ist... | null | https://raw.githubusercontent.com/ctford/Idris-Elba-Dev/e915e1d6b7a5921ba43d2572a9ad9b980619b8ee/src/Idris/ErrReverse.hs | haskell | For display purposes, apply any 'error reversal' transformations so that
errors will be more readable
Assume pattern bindings match in l and r (if they don't just treat
the rule as invalid and return t)
If any duplicate mappings, it's a failure
no matching Binds, for now...
if the term under a lambda is huge, th... | # LANGUAGE PatternGuards #
module Idris.ErrReverse where
import Idris.AbsSyntax
import Idris.Core.TT
import Util.Pretty
import Data.List
import Debug.Trace
errReverse :: IState -> Term -> Term
errReverse ist t = rewrite 5 (elideLambdas t)
where
rewrite 0 t = t
rewrite n t = let t' = foldl applyRule t (r... |
4b16759f8af0496b7add6723a749d7353b554c82563558d8bbc5d9fd68729cfb | olieidel/correlate | core.clj | (ns correlate.core
(:require [clj-time.core :as t]
[clj-time.format :as f]
[clojure.data.csv :as data.csv]
[clojure.java.io :as io]
[clojure.java.shell :refer [sh]]
[clojure.string :as str]
[correlate.csv :as csv]
[correlate.emfit-qs ... | null | https://raw.githubusercontent.com/olieidel/correlate/6f2e09fe67e223cc43e0bf7d4287f2de849848ff/src/correlate/core.clj | clojure | -- Magic Numbers ------------------------------------------------------------
-- CSV Parsing --------------------------------------------------------------
time zone to UTC+1. but then we want to see the times in
UTC time, so we convert the times to UTC time. in summary,
hour. simple, right?
FIXME: hard-coded tim... | (ns correlate.core
(:require [clj-time.core :as t]
[clj-time.format :as f]
[clojure.data.csv :as data.csv]
[clojure.java.io :as io]
[clojure.java.shell :refer [sh]]
[clojure.string :as str]
[correlate.csv :as csv]
[correlate.emfit-qs ... |
3c35e4aedfd2eda7b6624b25ec0b7de0747f861850a799c3c2d9bfad04384d03 | capital-match/hdo | Common.hs | # LANGUAGE FlexibleContexts , MultiParamTypeClasses , OverloadedStrings #
module Network.DO.Net.Common where
import Control.Comonad.Env.Class (ComonadEnv, ask)
import Data.Aeson as A hiding (Result)
import qualified Data.Aeson.Types as A
import qualified Data.HashMap.Strict ... | null | https://raw.githubusercontent.com/capital-match/hdo/79e46f182f11374ec85d7cb9f17ffd5a8ed2f9ad/src/Network/DO/Net/Common.hs | haskell | |Extract a typed result from a JSON output | # LANGUAGE FlexibleContexts , MultiParamTypeClasses , OverloadedStrings #
module Network.DO.Net.Common where
import Control.Comonad.Env.Class (ComonadEnv, ask)
import Data.Aeson as A hiding (Result)
import qualified Data.Aeson.Types as A
import qualified Data.HashMap.Strict ... |
71eb2da0cfd901c98aca8df609489526469134347ba3e602257b1f836971ac5e | RolfRolles/PandemicML | Lexer.ml | # 1 "Lexer.mll"
open Parser
# 6 "Lexer.ml"
let __ocaml_lex_tables = {
Lexing.lex_base =
"\000\000\078\000\160\000\241\255\000\000\243\255\244\255\245\255\
\246\255\247\255\248\255\249\255\250\255\235\000\054\001\002\000\
\254\255\255\255\129\001\204\001\023\002\098\002\242\255";
Lexing.lex_backtrk ... | null | https://raw.githubusercontent.com/RolfRolles/PandemicML/9c31ecaf9c782dbbeb6cf502bc2a6730316d681e/Projects/Compiler/Lexer.ml | ocaml | # 1 "Lexer.mll"
open Parser
# 6 "Lexer.ml"
let __ocaml_lex_tables = {
Lexing.lex_base =
"\000\000\078\000\160\000\241\255\000\000\243\255\244\255\245\255\
\246\255\247\255\248\255\249\255\250\255\235\000\054\001\002\000\
\254\255\255\255\129\001\204\001\023\002\098\002\242\255";
Lexing.lex_backtrk ... | |
f759007a8a5dca98689371623b313e07e96c72e65a9f5be8f7f109f4cfc6e76a | krukow/calabash-script | tests.cljs | (ns calabash-script.tests
(:require [calabash-script.log :as log]
[calabash-script.utils :as utils]))
(defn fail
[reason & kwargs]
(let [{:keys [screenshot]
:or {screenshot "screenshot"}} (apply hash-map kwargs)]
(throw (new js/Error reason))))
(defn fail-if [condition & kwargs]
(le... | null | https://raw.githubusercontent.com/krukow/calabash-script/7e54beab5aa83087c7b52a55eca3d1828d2d0f36/src/cljs/calabash_script/tests.cljs | clojure | (ns calabash-script.tests
(:require [calabash-script.log :as log]
[calabash-script.utils :as utils]))
(defn fail
[reason & kwargs]
(let [{:keys [screenshot]
:or {screenshot "screenshot"}} (apply hash-map kwargs)]
(throw (new js/Error reason))))
(defn fail-if [condition & kwargs]
(le... | |
1f802054bc8dc4ca3db4ded6727a48b035fe5e3fcc122387e13e64503d35003a | exoscale/pithos | blob.clj | (ns io.pithos.blob
"Blobstore interaction. This is one of the four storage protocols.
Storage protocols are split even though they mostly target cassandra
because it allows:
- Easy implementation of the protocol targetting different DBs
- Splitting data in different keyspace with different replication pr... | null | https://raw.githubusercontent.com/exoscale/pithos/54790f00fbfd330c6196d42e5408385028d5e029/src/io/pithos/blob.clj | clojure |
A word on storage protocols
---------------------------
All storage protocols expose functions to produce side-effects
and a `converge!` function whose role is to apply the schema
CQL Schema
| (ns io.pithos.blob
"Blobstore interaction. This is one of the four storage protocols.
Storage protocols are split even though they mostly target cassandra
because it allows:
- Easy implementation of the protocol targetting different DBs
- Splitting data in different keyspace with different replication pr... |
1339dfbb51232413a8d22a56426538004e74c7b98a67476d1ec849147c6452e9 | swannodette/logic-tutorial | project.clj | (defproject logic-tutorial "1.0.0"
:description "A Very Gentle Introduction to Relational and Functional Programming"
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/tools.macro "0.1.2"]
[org.clojure/core.logic "0.8.5"]])
| null | https://raw.githubusercontent.com/swannodette/logic-tutorial/923c4d946d82af4e8be25c8f98a3d0c589b7a020/project.clj | clojure | (defproject logic-tutorial "1.0.0"
:description "A Very Gentle Introduction to Relational and Functional Programming"
:dependencies [[org.clojure/clojure "1.5.1"]
[org.clojure/tools.macro "0.1.2"]
[org.clojure/core.logic "0.8.5"]])
| |
2db977fbc408bbb4cc2d8c4b0f48b6cd27900ec0031ef37013c44d106c09f6a9 | melange-re/melange-compiler-libs | tast_mapper.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/melange-re/melange-compiler-libs/2fac95b0ea97fb676240662aeeec8c6f6495dd9c/typing/tast_mapper.ml | ocaml | ************************************************************************
OCaml
... | , LexiFi
Copyright 2015 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Asttypes
open Typedtree
type mapper =
{
binding_op: mapper -> binding_op -> binding_op;
c... |
884f9aaace6c908deaa1861a11217caea46d0db35511310c8738675f053ed623 | gregr/racket-misc | record.rkt | #lang racket/base
(provide
record
records
record-struct
)
(require
(for-syntax
"syntax.rkt"
racket/base
racket/list
)
racket/dict
racket/list
racket/match
)
(define-syntax record-struct
(syntax-rules ()
((_ name (field ...) struct-rest ...)
(struct name (field ...) #:trans... | null | https://raw.githubusercontent.com/gregr/racket-misc/0a5c9d4875288795e209d06982b82848c989d08b/record.rkt | racket | #lang racket/base
(provide
record
records
record-struct
)
(require
(for-syntax
"syntax.rkt"
racket/base
racket/list
)
racket/dict
racket/list
racket/match
)
(define-syntax record-struct
(syntax-rules ()
((_ name (field ...) struct-rest ...)
(struct name (field ...) #:trans... | |
d4e45c2f6c6f8811b15a3575d3462d997aa521d8508f78393cefbf7195ea7860 | birthevdb/Latent-Effect-and-Handlers | General.hs | {-# LANGUAGE GADTs #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE TypeOperators #
# LANGUAGE KindSignatures #
# LANGUAGE EmptyCase #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE DeriveFunctor #
module General where
import Control.Monad
-------------------------------
-- Trees and their I... | null | https://raw.githubusercontent.com/birthevdb/Latent-Effect-and-Handlers/398167aa3a18572afa1ecc9ecdd6b37c97495f90/General.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE RankNTypes #
-----------------------------
Trees and their Instances --
-----------------------------
------------------------
Datatypes a la Carte --
------------------------
# OVERLAPPABLE #
# OVERLAPPABLE #
----------------------------------------
------------------------------------... | # LANGUAGE TypeOperators #
# LANGUAGE KindSignatures #
# LANGUAGE EmptyCase #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE DeriveFunctor #
module General where
import Control.Monad
data Tree (σ :: * -> (* -> *) -> *) (l :: * -> *) a where
Leaf :: a -> Tree σ l a
Node :: σ p ... |
640dd751471b4d4a0390014f048435e7794bf7a581309e93c8180931848d4398 | zotonic/zotonic | action_wires_editor_add.erl | @author < >
2010
Date : 2010 - 11 - 22
%% @doc Add WYSIWYG editor controls to all textarea.z_editor in the target
Copyright 2010
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the... | null | https://raw.githubusercontent.com/zotonic/zotonic/852f627c28adf6e5212e8ad5383d4af3a2f25e3f/apps/zotonic_mod_wires/src/actions/action_wires_editor_add.erl | erlang | @doc Add WYSIWYG editor controls to all textarea.z_editor in the target
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expr... | @author < >
2010
Date : 2010 - 11 - 22
Copyright 2010
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(action_wires_editor_add).
-include_lib("zotonic_core/include/zotonic.hrl").
-export([
render_... |
07bd6e92619f7b3b16f3f2e8625745bf39c7f37c484c8c81f6131d7bbcdb154d | xh4/web-toolkit | header.lisp | (in-package :http-test)
(in-suite :http-test)
(test read-header
(it
(with-read-header (hd '("foo: bar"))
(is (typep hd 'header))
(is (= 1 (length (header-fields hd))))))
(it
(with-read-header (hd '("foo: bar" ""))
(is (typep hd 'header))
(is (= 1 (length (header-fields hd))))))
... | null | https://raw.githubusercontent.com/xh4/web-toolkit/e510d44a25b36ca8acd66734ed1ee9f5fe6ecd09/test/http/header.lisp | lisp | (signals error (header-field "foo"))
(signals error (header-field))
(signals error (header-field "foo" "bar" "goo")) | (in-package :http-test)
(in-suite :http-test)
(test read-header
(it
(with-read-header (hd '("foo: bar"))
(is (typep hd 'header))
(is (= 1 (length (header-fields hd))))))
(it
(with-read-header (hd '("foo: bar" ""))
(is (typep hd 'header))
(is (= 1 (length (header-fields hd))))))
... |
cd6c8d68ce7faf3e693ca09e6678260e75497a1cc8e1ea37d48fa275229c6219 | lambdaisland/launchpad | deps.clj | (ns lambdaisland.launchpad.deps
(:require
[clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.tools.deps.alpha :as deps]
[clojure.string :as str]
[lambdaisland.classpath.watch-deps :as watch-deps]
[lambdaisland.classpath :as licp]))
(defn basis [opts]
(let [deps-local-file (io/file "deps.loca... | null | https://raw.githubusercontent.com/lambdaisland/launchpad/821a42206fe630f42cf4f4bd080ccbbc7fdd5957/src/lambdaisland/launchpad/deps.clj | clojure | (ns lambdaisland.launchpad.deps
(:require
[clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.tools.deps.alpha :as deps]
[clojure.string :as str]
[lambdaisland.classpath.watch-deps :as watch-deps]
[lambdaisland.classpath :as licp]))
(defn basis [opts]
(let [deps-local-file (io/file "deps.loca... | |
e17a12448e2a38dcd35e69975c53fd137ca784b48be3de0e93124867f68568c5 | hipsleek/hipsleek | smtlib_main.ml | (* auto-generated by gt *)
let print_help () =
print_endline " ./compile -sleek < file>.smt2 "
print_endline "./compile <file>.smt2"
;;
if (Array.length Sys.argv) >= 1
then
(* let option = Sys.argv.(1) in *)
(* if option = "-sleek" *)
(* then *)
(* let in_file_name = Sys.argv.(2) in *)
let in_file_nam... | null | https://raw.githubusercontent.com/hipsleek/hipsleek/596f7fa7f67444c8309da2ca86ba4c47d376618c/smt2slk_src/smtlib_main.ml | ocaml | auto-generated by gt
let option = Sys.argv.(1) in
if option = "-sleek"
then
let in_file_name = Sys.argv.(2) in
else
print_help ()
let parsed :=
then
let option = Sys.argv.(1) in
if option = "-sleek"
then
let input_file_name = Sys.argv.(2) in
then
let _ ... |
let print_help () =
print_endline " ./compile -sleek < file>.smt2 "
print_endline "./compile <file>.smt2"
;;
if (Array.length Sys.argv) >= 1
then
let in_file_name = Sys.argv.(1) in
if ((String.length in_file_name) >= 5) &&
(String.sub in_file_name ((String.length in_file_name) - 4) 4) = "smt2"
the... |
ff5825791570d3c335083597ca4d0f238a4966c852e405249dd8bc66224e0f91 | klutometis/sicp-chicken | sicp-eval-ec.scm | @(heading "sicp-eval-ec")
(module sicp-eval-ec
@("The explicit control evaluator from chapter 5")
(get-register-contents
make-machine
set-register-contents!
start)
(import chicken scheme)
(use debug sicp-eval)
(include "sicp-eval-ec-core.scm"))
| null | https://raw.githubusercontent.com/klutometis/sicp-chicken/0f65de82acb06ae6abcff655dc1aea115cfdc142/sicp-eval-ec.scm | scheme | @(heading "sicp-eval-ec")
(module sicp-eval-ec
@("The explicit control evaluator from chapter 5")
(get-register-contents
make-machine
set-register-contents!
start)
(import chicken scheme)
(use debug sicp-eval)
(include "sicp-eval-ec-core.scm"))
| |
fe2959873b8eb0cb716783047f559255db8ffac8335e68a25f87e6b987da90e9 | benoitc/couch_zmq | couch_zmq_pubsub.erl | %%% -*- erlang -*-
%%%
This file is part of couch_zmq released under the MIT license .
%%% See the NOTICE for more information.
-module(couch_zmq_pubsub).
-behaviour(gen_server).
-include("couch_db.hrl").
-export([start_link/0, config_change/2]).
-export([send/3]).
-export([init/1,
handle_call/3,
... | null | https://raw.githubusercontent.com/benoitc/couch_zmq/9f7f24b39ad8c357b714c7338d521a5d4551b3e6/src/couch_zmq_pubsub.erl | erlang | -*- erlang -*-
See the NOTICE for more information.
private api | This file is part of couch_zmq released under the MIT license .
-module(couch_zmq_pubsub).
-behaviour(gen_server).
-include("couch_db.hrl").
-export([start_link/0, config_change/2]).
-export([send/3]).
-export([init/1,
handle_call/3,
handle_cast/2,
handle_info/2,
terminate/2,
... |
aa02d59359a0c586d9baa3d71a0583c48e957283042c289958a5d4653ef187a0 | bhauman/advent-of-clojure | day2.clj | (ns advent-2016.day2
(:require
[clojure.java.io :as io]))
(def lines (line-seq (io/reader (io/resource "2016/day2"))))
(def dir {\U [0 -1]
\D [0 1]
\R [1 0]
\L [-1 0]})
(def pos-number #(+ 5 (* 3 (second %)) (first %)))
(defn in-bounds? [[x y]]
(and (<= -1 x 1) (<= -1 y 1)))
(d... | null | https://raw.githubusercontent.com/bhauman/advent-of-clojure/856763baf45bf7bf452ffd304dc1b89f9bc879a6/src/advent-2016/day2.clj | clojure | (ns advent-2016.day2
(:require
[clojure.java.io :as io]))
(def lines (line-seq (io/reader (io/resource "2016/day2"))))
(def dir {\U [0 -1]
\D [0 1]
\R [1 0]
\L [-1 0]})
(def pos-number #(+ 5 (* 3 (second %)) (first %)))
(defn in-bounds? [[x y]]
(and (<= -1 x 1) (<= -1 y 1)))
(d... | |
621f36335e3c5136f9321c9d67e984661fa373fa0e31bc80fb7c0d4c89981731 | graninas/Functional-Design-and-Architecture | App.hs | module App where
import Control.Monad
import Data.IORef (IORef)
import Lang
data Meteor = Meteor
{ size :: Int
, mass :: Int
}
deriving (Show, Read, Eq)
type ReportingChannel = IORef [Meteor]
-- Methods
forkProcess :: LangL () -> AppL ()
forkProcess = undefined
e... | null | https://raw.githubusercontent.com/graninas/Functional-Design-and-Architecture/1736abc16d3e4917fc466010dcc182746af2fd0e/First-Edition/BookSamples/CH06/6.2.2/ReducingComplexity/app/App.hs | haskell | Methods | module App where
import Control.Monad
import Data.IORef (IORef)
import Lang
data Meteor = Meteor
{ size :: Int
, mass :: Int
}
deriving (Show, Read, Eq)
type ReportingChannel = IORef [Meteor]
forkProcess :: LangL () -> AppL ()
forkProcess = undefined
evalLang ... |
bfa20758208a1e9612ff93aac1ec4cecf8cbb0847ffc6c1cb292687d46248b79 | EFanZh/EOPL-Exercises | exercise-5.15.rkt | #lang eopl
Exercise 5.15 [ ★ ] Our continuation data type contains just the single constant , end - cont , and all the other
;; continuation-builders have a single continuation argument. Implement continuations by representing them as lists,
;; where (end-cont) is represented by the empty list, and each other contin... | null | https://raw.githubusercontent.com/EFanZh/EOPL-Exercises/11667f1e84a1a3e300c2182630b56db3e3d9246a/solutions/exercise-5.15.rkt | racket | continuation-builders have a single continuation argument. Implement continuations by representing them as lists,
where (end-cont) is represented by the empty list, and each other continuation is represented by a nonempty list
whose car contains a distinctive data structure (called frame or activation record) and wh... | #lang eopl
Exercise 5.15 [ ★ ] Our continuation data type contains just the single constant , end - cont , and all the other
(define the-lexical-spec
'([whitespace (whitespace) skip]
[comment ("%" (arbno (not #\newline))) skip]
[identifier (letter (arbno (or letter digit "_" "-" "?"))) symbol]
[numbe... |
9d57de4ebadf66b2231f573ca92e036f2bfc2c4c27a772dc324e2f5f4331fe38 | ha-mo-we/Racer | num-restr.lisp | -*- Mode : Lisp ; Syntax : Ansi - Common - Lisp ; Package : RACER ; Base : 10 -*-
Copyright ( c ) 1998 - 2014 ,
, , .
;;; All rights reserved.
Racer is distributed under the following BSD 3 - clause license
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are p... | null | https://raw.githubusercontent.com/ha-mo-we/Racer/d690841d10015c7a75b1ded393fcf0a33092c4de/source/num-restr.lisp | lisp | Syntax : Ansi - Common - Lisp ; Package : RACER ; Base : 10 -*-
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 c... |
Copyright ( c ) 1998 - 2014 ,
, , .
Racer is distributed under the following BSD 3 - clause license
Neither the name Racer nor the names of its contributors may be used
CONTRIBUTORS " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING ,
VOLKER HAARSLEV , RALF MOELLER , NOR FOR ANY
... |
840af33d5887b108a9e0f2b472dc0bb15d6d93af1a91ecdfbb1f8cce5a8e1512 | cushon/project-euler | 83.rkt | #lang racket
(require "common.rkt")
; Find the minimal path sum from the top left to bottom right of a matrix,
usin Dijkstra 's algorithm .
(define (solve)
(define matrix
(map (lambda (x) (map string->number (csv->lst x)))
(file->lines "83.txt")))
(define width (length (car matrix)))
(defi... | null | https://raw.githubusercontent.com/cushon/project-euler/d7fcbfff0cd59b2c3691293ff35bb2043b409f68/83.rkt | racket | Find the minimal path sum from the top left to bottom right of a matrix,
This is stupidly slow because I don't want to implement a fast rekeyable
priority queue, so I do a linear search for the minimal candidate instead
TODO: fib-heap... | #lang racket
(require "common.rkt")
usin Dijkstra 's algorithm .
(define (solve)
(define matrix
(map (lambda (x) (map string->number (csv->lst x)))
(file->lines "83.txt")))
(define width (length (car matrix)))
(define height (length matrix))
(define arr (list->vector (reverse (foldl a... |
6cff9a761b999f897bb4da5f4d3f3153f1c2bd0d2f7330650f3647ae795f4930 | onyx-platform/onyx | local_segment_encoder.clj | (ns ^{:no-doc true} onyx.messaging.serializers.local-segment-encoder
(:import [org.agrona.concurrent UnsafeBuffer]))
(defprotocol PEncoder
(add-batch-ref [this batch-ref])
(offset [this])
(length [this])
(wrap [this offset]))
(deftype Encoder [^UnsafeBuffer buffer
^:unsynchronized-mutable... | null | https://raw.githubusercontent.com/onyx-platform/onyx/74f9ae58cdbcfcb1163464595f1e6ae6444c9782/src/onyx/messaging/serializers/local_segment_encoder.clj | clojure | (ns ^{:no-doc true} onyx.messaging.serializers.local-segment-encoder
(:import [org.agrona.concurrent UnsafeBuffer]))
(defprotocol PEncoder
(add-batch-ref [this batch-ref])
(offset [this])
(length [this])
(wrap [this offset]))
(deftype Encoder [^UnsafeBuffer buffer
^:unsynchronized-mutable... | |
a5ae597012a2f466a395f9dc689f39b05cbfedd21aa814fce8a6e5e3b73f8926 | alanzplus/EOPL | 5.2.rkt | ; See cp-interpreter.rkt
; (define-datatype continuation continuation?)
; (define apply-cont) | null | https://raw.githubusercontent.com/alanzplus/EOPL/d7b06392d26d93df851d0ca66d9edc681a06693c/EOPL/ch5/5.2.rkt | racket | See cp-interpreter.rkt
(define-datatype continuation continuation?)
(define apply-cont) | |
28d9bb8fea1aea288e3750672b51ab2ca9dfdd83518b0af135a85ad067c446d6 | spawnfest/eep49ers | wxGridCellBoolRenderer.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2009 - 2020 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/spawnfest/eep49ers/d1020fd625a0bbda8ab01caf0e1738eb1cf74886/lib/wx/src/gen/wxGridCellBoolRenderer.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 2009 - 2020 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(wxGridCellBoolRenderer).
-include("wxe.hrl").
-export([destroy/1,new/0]).
-export([draw/8,getBestSize/6,par... |
8c45a88d409e8d9f4b2f31ff63b36657bda852b746d81df88f057c50701c8ee0 | bluelisp/hemlock | hi-integrity.lisp | ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
;;;
;;; **********************************************************************
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
;;;
#+CMU (ext:file-comment
"$Header: /home/david/ph... | null | https://raw.githubusercontent.com/bluelisp/hemlock/47e16ba731a0cf4ffd7fb2110e17c764ae757170/unused/hi-integrity.lisp | lisp | -*- Mode: Lisp; indent-tabs-mode: nil -*-
**********************************************************************
**********************************************************************
Written by Skef Wholey
Hack to check a buffer's integrity.
| This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
#+CMU (ext:file-comment
"$Header: /home/david/phemlock/cvsroot/phemlock/unused/hi-integrity.lisp,v 1.1 2004-07-09 13:39:13 gbaumann Exp $")
(in-package "HEMLOCK-INTERNALS")
(def... |
ebcbe6e2a08ca48bc4203a7a73690df1cad0cff79ed1aca39ec8b5c05693f68d | OCamlPro/ocaml-benchs | math.ml | (***************************************************************************)
Copyright ( C ) 2000 - 2013 LexiFi SAS . All rights reserved .
(* *)
(* This program is free software: you can redistribute it and/or modify *)
it ... | null | https://raw.githubusercontent.com/OCamlPro/ocaml-benchs/98047e112574e6bf55137dd8058f227a9f40281b/lexifi-g2pp/math.ml | ocaml | *************************************************************************
This program is free software: you can redistribute it and/or modify
or (at your option) any later version.
... | Copyright ( C ) 2000 - 2013 LexiFi SAS . All rights reserved .
it under the terms of the GNU General Public License as published
by the Free Software Foundation , either version 3 of the License ,
You should have received a copy of the GNU General Public License
let p, a1, ... |
1b551b7cfe9bfbe7e4dad347ea853cc5e6210fdde7c7303498bd9c59830f9ab9 | crategus/cl-cffi-gtk | menu-popup.lisp | ;;;; Example Menu Popup - 2021-11-14
(in-package :gtk-example)
(defun example-menu-popup (&optional application)
(within-main-loop
(let ((window (make-instance 'gtk-window
:type :toplevel
:application application
... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/ba198f7d29cb06de1e8965e1b8a78522d5430516/demo/gtk-example/menu-popup.lisp | lisp | Example Menu Popup - 2021-11-14
Create pop-up menu for button |
(in-package :gtk-example)
(defun example-menu-popup (&optional application)
(within-main-loop
(let ((window (make-instance 'gtk-window
:type :toplevel
:application application
:default-width 300
... |
0f08279f2191954dace8fb62de6cab090437addc8a0ae7111abf0e250bf66b88 | mchung94/pyramid-solver | pyramid-solver.lisp | (in-package #:pyramid-solver)
;;; Card and Deck definitions
(defvar *rank-characters* "A23456789TJQK"
"All valid card rank characters.")
(defvar *suit-characters* "cdhs"
"All valid card suit characters.")
(defun cardp (obj)
"Cards are two-letter strings containing a rank followed by a suit."
(and (stringp ob... | null | https://raw.githubusercontent.com/mchung94/pyramid-solver/c6dde73fd27ec817e2f1329f2a761b384cd8c663/src/pyramid-solver.lisp | lisp | Card and Deck definitions
improper lists can't be standard decks
This needs to be fast or there will be delays during compilation.
Basically this builds valid pyramids recursively bottom-up as lists of
row flags, then converts each pyramid into a pyramid-flags value.
Pyramid Soltaire game state definitions
Howev... | (in-package #:pyramid-solver)
(defvar *rank-characters* "A23456789TJQK"
"All valid card rank characters.")
(defvar *suit-characters* "cdhs"
"All valid card suit characters.")
(defun cardp (obj)
"Cards are two-letter strings containing a rank followed by a suit."
(and (stringp obj)
(= 2 (length obj))
... |
f4aa1ad3a0af1e19529a61a0da7251b39ab9791399d9afabac9b5440eecdd198 | kronusaturn/lw2-viewer | schema-type.lisp | (uiop:define-package #:lw2.schema-type
(:use #:cl #:lw2.utils)
(:export #:define-schema-type #:undefine-schema-type #:find-schema-type #:schema-bind))
(in-package #:lw2.schema-type)
(defvar *schema-types* nil)
(defun delete-schema-type (name)
(setf *schema-types* (delete name *schema-types* :key #'car)))
(def... | null | https://raw.githubusercontent.com/kronusaturn/lw2-viewer/ce8978034d60eff1b15fb78e87028adbec429965/src/schema-type.lisp | lisp | Optimization, assuming strings coming from the backend
can never be displaced etc. | (uiop:define-package #:lw2.schema-type
(:use #:cl #:lw2.utils)
(:export #:define-schema-type #:undefine-schema-type #:find-schema-type #:schema-bind))
(in-package #:lw2.schema-type)
(defvar *schema-types* nil)
(defun delete-schema-type (name)
(setf *schema-types* (delete name *schema-types* :key #'car)))
(def... |
6feabd47469e5e4d7e5eb029c93f54deeaaa683073727d430af0211e7e9ca794 | spechub/Hets | ComputeTheory.hs | |
Module : ./Static / ComputeTheory.hs
Description : compute the theory of a node
Copyright : ( c ) and DFKI GmbH 2009
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : provisional
Portability : non - portable(Logic )
compute the theory of a nod... | null | https://raw.githubusercontent.com/spechub/Hets/98f81719637d37092aa29178822f662e99e69e36/Static/ComputeTheory.hs | haskell | * nodes with incoming hiding definition links
| mark all nodes if they have incoming hiding edges.
Assume reference nodes to other libraries being properly marked already.
do not crash here
translate theory and turn all imported theorems into axioms
^ old label
^ node with new label
update links own id if re... | |
Module : ./Static / ComputeTheory.hs
Description : compute the theory of a node
Copyright : ( c ) and DFKI GmbH 2009
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : provisional
Portability : non - portable(Logic )
compute the theory of a nod... |
233a845ecdab37d8793644c27db996fd69d60853c7cc070049da6d5bd5cbb661 | walkie/Hagl | Hagl.hs | | This module provides a convenient way to import all of Hagl at once .
module Hagl (
module Hagl.Exec,
module Hagl.Extensive,
module Hagl.Game,
module Hagl.List,
module Hagl.Normal,
module Hagl.Payoff,
module Hagl.Print,
module Hagl.Simultaneous,
module Hagl.StateGames,
module Hagl.Strategy,
mo... | null | https://raw.githubusercontent.com/walkie/Hagl/ac1edda51c53d2b683c4ada3f1c3d4d14a285d38/src/Hagl.hs | haskell | | This module provides a convenient way to import all of Hagl at once .
module Hagl (
module Hagl.Exec,
module Hagl.Extensive,
module Hagl.Game,
module Hagl.List,
module Hagl.Normal,
module Hagl.Payoff,
module Hagl.Print,
module Hagl.Simultaneous,
module Hagl.StateGames,
module Hagl.Strategy,
mo... | |
0fc16e343f5e684151862792fd5bf5ba6dabc2e89e238aeb4da3e4872c920b05 | copton/bitcoin-script-tools | Disassembler.hs | module Language.Bitcoin.Disassembler
export { { { 1
(
run_disassembler
) where
import { { { 1
import Language.Bitcoin.Types
run_disassembler : : Binary - > Code { { { 1
run_disassembler :: Binary -> Code
run_disassembler = undefined
| null | https://raw.githubusercontent.com/copton/bitcoin-script-tools/078a021a5cdebea50b8a2f28bf452792cae7feaf/src/Language/Bitcoin/Disassembler.hs | haskell | module Language.Bitcoin.Disassembler
export { { { 1
(
run_disassembler
) where
import { { { 1
import Language.Bitcoin.Types
run_disassembler : : Binary - > Code { { { 1
run_disassembler :: Binary -> Code
run_disassembler = undefined
| |
a6dd43e09de48303a8ad72e7a6a8112e51dae9bb7251ee80e19e9222f556bcfa | tobbebex/GPipe | Shader.hs | # LANGUAGE TypeOperators , TypeFamilies , FlexibleInstances , MultiParamTypeClasses , EmptyDataDecls , TypeSynonymInstances #
-----------------------------------------------------------------------------
--
-- Module : Shader
Copyright :
-- License : BSD3
--
Maintainer :
-- Stability : Ex... | null | https://raw.githubusercontent.com/tobbebex/GPipe/9ff3afde0416c118971c5a2f93effdc75ef59e88/src/Shader.hs | haskell | ---------------------------------------------------------------------------
Module : Shader
License : BSD3
Stability : Experimental
|
---------------------------------------------------------------------------
Use the existing instances of this class to create new ones.
| The type on the CPU.
... | # LANGUAGE TypeOperators , TypeFamilies , FlexibleInstances , MultiParamTypeClasses , EmptyDataDecls , TypeSynonymInstances #
Copyright :
Maintainer :
Portability : Portable
module Shader (
GPU(..),
rasterizeVertex,
inputVertex,
fragmentFrontFacing,
Shader(),
V,
F,
... |
c03e3f8e05264235a024c6b1e83e22dc04f6d8c5562957f341b089ef9fa7a30f | clojure-interop/aws-api | AmazonWorkLinkAsyncClient.clj | (ns com.amazonaws.services.worklink.AmazonWorkLinkAsyncClient
"Client for accessing WorkLink asynchronously. Each asynchronous method will return a Java Future object representing
overloads which accept an AsyncHandler can be used to receive notification when
an asynchronous operation completes.
Amazon WorkLi... | null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.worklink/src/com/amazonaws/services/worklink/AmazonWorkLinkAsyncClient.clj | clojure | (ns com.amazonaws.services.worklink.AmazonWorkLinkAsyncClient
"Client for accessing WorkLink asynchronously. Each asynchronous method will return a Java Future object representing
overloads which accept an AsyncHandler can be used to receive notification when
an asynchronous operation completes.
Amazon WorkLi... | |
8b770fc3efeb6679073ed23f391f0a9dabe6e179f14dfe9770bae62edf6d62de | ChrisPenner/trek | Spec.hs | main :: IO ()
main = do
return ()
| null | https://raw.githubusercontent.com/ChrisPenner/trek/26556b8157b38be94718dce7548f81350772d072/trek/test/Spec.hs | haskell | main :: IO ()
main = do
return ()
| |
8a5e3b8f820259120844e48db8fc23a08f9a246e7ae893227b07949ee045ec7f | thma/WhyHaskellMatters | AllTestsSpec.hs | module Tests.AllTestsSpec where
import Test.Hspec
import Test.QuickCheck
import Functions
import LazyEvaluation
import AlgebraicDataTypes
spec :: Spec
spec =
describe "Why Haskell matters" $ do
it "it has functions" $
property $ \x -> square x `shouldBe` ... | null | https://raw.githubusercontent.com/thma/WhyHaskellMatters/e6fe2973230d342ad222490984722baad3d93389/test/Tests/AllTestsSpec.hs | haskell | module Tests.AllTestsSpec where
import Test.Hspec
import Test.QuickCheck
import Functions
import LazyEvaluation
import AlgebraicDataTypes
spec :: Spec
spec =
describe "Why Haskell matters" $ do
it "it has functions" $
property $ \x -> square x `shouldBe` ... | |
3a3ad094fb49127972eabf0effe402a755030a4cc62c23bafae061b1e377f6ec | mark-gerarts/nature-of-code | sketch.lisp | (defpackage :nature-of-code.introduction.exercise-7
(:export :start-sketch)
(:use :cl :trivial-gamekit :black-tie))
(in-package :nature-of-code.introduction.exercise-7)
(defvar *width* 800)
(defvar *height* 600)
(defvar *black* (vec4 0 0 0 1))
(defvar *gray* (vec4 0.5 0.5 0.5 1))
(defun perlin-noise-1d (dt axis)... | null | https://raw.githubusercontent.com/mark-gerarts/nature-of-code/4f8612e18a2a62012e44f08a8e0a4f8aec21a1ec/0.%20Introduction/Exercise%20I.7%20-%20Perlin%20noise%20step%20size%20walker/sketch.lisp | lisp | (defpackage :nature-of-code.introduction.exercise-7
(:export :start-sketch)
(:use :cl :trivial-gamekit :black-tie))
(in-package :nature-of-code.introduction.exercise-7)
(defvar *width* 800)
(defvar *height* 600)
(defvar *black* (vec4 0 0 0 1))
(defvar *gray* (vec4 0.5 0.5 0.5 1))
(defun perlin-noise-1d (dt axis)... | |
b43d5a6173ebeedf3415197ea925fe65f4de881f41fdc2fa01dc03d56d9ea9c6 | diffusionkinetics/open | Types.hs | # LANGUAGE OverloadedStrings , ExistentialQuantification , ExtendedDefaultRules , FlexibleContexts , Rank2Types , TemplateHaskell , ScopedTypeVariables #
module Dashdo.Types where
import Lucid
import Data.Text (Text, pack)
import qualified Data.Text.Lazy as TL
import Control.Monad.State.Strict
import Lens.Micro
impor... | null | https://raw.githubusercontent.com/diffusionkinetics/open/673d9a4a099abd9035ccc21e37d8e614a45a1901/dashdo/src/Dashdo/Types.hs | haskell | # LANGUAGE OverloadedStrings , ExistentialQuantification , ExtendedDefaultRules , FlexibleContexts , Rank2Types , TemplateHaskell , ScopedTypeVariables #
module Dashdo.Types where
import Lucid
import Data.Text (Text, pack)
import qualified Data.Text.Lazy as TL
import Control.Monad.State.Strict
import Lens.Micro
impor... | |
36f11db0467cb9e142fca6d787b97cc684ac60cd134d3c6ab1f1a6902e0834f3 | softwarelanguageslab/maf | string.scm | (define x "hello")
(string-append x " world")
| null | https://raw.githubusercontent.com/softwarelanguageslab/maf/daf47e4bf939936535739a83fcf9c09bc93f287f/test/R5RS/various/string.scm | scheme | (define x "hello")
(string-append x " world")
| |
c93dae966561f247f76fc6841367b7d3d5eeb07072cdc38c174af078b8a49066 | gizmo385/discord.clj | base.clj | (ns discord.api.base
"Implements the core REST API logic for the Discord API, including support for rate limiting. Calls
to specific APIs should be done in other namespaces."
(:require
[clj-http.client :as client]
[clojure.data.json :as json]
[discord.types.auth :as a]
[discord.types.snowflake :a... | null | https://raw.githubusercontent.com/gizmo385/discord.clj/5c2cadc8faa25e8bb50211f60457057cbed6dd90/src/discord/api/base.clj | clojure | Based on the HTTP method of the request being performed, we'll be attaching either a JSON
body or URL query parameters to the request.
Default
Log any other errors that we encounter | (ns discord.api.base
"Implements the core REST API logic for the Discord API, including support for rate limiting. Calls
to specific APIs should be done in other namespaces."
(:require
[clj-http.client :as client]
[clojure.data.json :as json]
[discord.types.auth :as a]
[discord.types.snowflake :a... |
38ba44fb3eeed364baa842972aefb8fd0be9412838860fad2dcd387cd80fcece | galdre/morphe | defn.cljc | Copyright ( c )
Copyright 2016 - 2019
Copyright 2017 - 2018 Workiva Inc.
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fas... | null | https://raw.githubusercontent.com/galdre/morphe/7f4272b49d5c90ed5a17effe5bf78d7aba84396d/src/morphe/impl/defn.cljc | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c )
Copyright 2016 - 2019
Copyright 2017 - 2018 Workiva Inc.
(ns morphe.impl.defn
#?(:clj (:require [clojure.tools.macro :refer [symbol-macrolet]])))
(defrecord ParsedFnDef [env wrapper namespace metadata fn-name arglists bodies aspects hofs])
(def fn-def->aspects :aspects)
#?(:clj
(defn- ... |
026d5c0cc0dd74ab5697968979daebbdf81ff3e5679e1d90b7c51b21f0902543 | jaspervdj/hakyll | Compiler.hs | --------------------------------------------------------------------------------
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ScopedTypeVariables #
module Hakyll.Core.Compiler
( Compiler
, getUnderlying
, getUnderlyingExtension
, makeItem
, getRoute
, getResourceBody
, getResou... | null | https://raw.githubusercontent.com/jaspervdj/hakyll/abd8c274ad19d8d4bd47b8ec7944a4b0bcaf7d33/lib/Hakyll/Core/Compiler.hs | haskell | ------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
| G... | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ScopedTypeVariables #
module Hakyll.Core.Compiler
( Compiler
, getUnderlying
, getUnderlyingExtension
, makeItem
, getRoute
, getResourceBody
, getResourceString
, getResourceLBS
, getResourceFilePath
, Internal.Snapshot... |
27bdc60187fe20d1533983dbc810bd84758bfe7d8bb363ff47cf212770dd7deb | camsaul/toucan2 | query_execution_backend.clj | (ns toucan2.query-execution-backend
(:require
[clojure.spec.alpha :as s]
[methodical.core :as m]
[toucan2.protocols :as protocols]
[toucan2.types :as types]))
(comment s/keep-me
types/keep-me)
(m/defmulti load-backend-if-needed
"Initialize a query execution backend if needed (usually this mea... | null | https://raw.githubusercontent.com/camsaul/toucan2/5204b34d46f5adb3e52b022218049abe9b336928/src/toucan2/query_execution_backend.clj | clojure | (ns toucan2.query-execution-backend
(:require
[clojure.spec.alpha :as s]
[methodical.core :as m]
[toucan2.protocols :as protocols]
[toucan2.types :as types]))
(comment s/keep-me
types/keep-me)
(m/defmulti load-backend-if-needed
"Initialize a query execution backend if needed (usually this mea... | |
a709b68a737d58fc03bc8f1d53eeb37d9f8d1f317c190aa321d618eb6bf9d346 | AvramRobert/omnia | eval_history_test.clj | (ns omnia.eval-history-test
(:require [clojure.test :refer :all]
[omnia.test-utils :refer :all]
[omnia.repl.eval-history :as eh]))
(deftest inserts-evaluation
(let [history (eh/create-eval-history 2)
eval (-> ["some"
"eval"]
... | null | https://raw.githubusercontent.com/AvramRobert/omnia/af515fb75d7492251436a3d844c0616c82d4eee0/test/omnia/eval_history_test.clj | clojure | (ns omnia.eval-history-test
(:require [clojure.test :refer :all]
[omnia.test-utils :refer :all]
[omnia.repl.eval-history :as eh]))
(deftest inserts-evaluation
(let [history (eh/create-eval-history 2)
eval (-> ["some"
"eval"]
... | |
7b89bec30f621cf7a4d2068efeefb2a1c9462e7adddf124595a8313e946db91e | futurice/haskell-mega-repo | API.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE TypeFamilies #
{-# LANGUAGE TypeOperators #-}
module Futurice.App.PlanMillProxy.API where
import Futurice.App.PlanMillProxy.Types (Stats)
imp... | null | https://raw.githubusercontent.com/futurice/haskell-mega-repo/2647723f12f5435e2edc373f6738386a9668f603/planmill-proxy/src/Futurice/App/PlanMillProxy/API.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators # | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
module Futurice.App.PlanMillProxy.API where
import Futurice.App.PlanMillProxy.Types (Stats)
import Futurice.Prelude
import PlanMill.Types.Query (SomeQuery, SomeResponse)
import Prelude ()
import Serva... |
fdd66c10c160da43fe673d4ee46cb9a2022df720dce8a3a62a783ab775aacd45 | Jell/euroclojure-2016 | we_are_live.cljs | (ns euroclojure.we-are-live)
(defn slide [{:keys [speaker]}]
[:div.slide.left
[:h1.centered "MVP live!"]
[:ul
[:li "Took us 3 months to be ready"]
[:li "Start to focus on new features!"]]])
| null | https://raw.githubusercontent.com/Jell/euroclojure-2016/a8ca883e8480a4616ede19995aaacd4a495608af/src/euroclojure/we_are_live.cljs | clojure | (ns euroclojure.we-are-live)
(defn slide [{:keys [speaker]}]
[:div.slide.left
[:h1.centered "MVP live!"]
[:ul
[:li "Took us 3 months to be ready"]
[:li "Start to focus on new features!"]]])
| |
930edef3a26d6eb61246d2c3d707999d86067ab9c5469e1e19fb2f166ca199d5 | seandepagnier/cruisingplot | gps.scm | Copyright ( C ) 2009 , 2010 < >
;;
This Program is free software ; you can redistribute it and/or
;; modify it under the terms of the GNU General Public
License as published by the Free Software Foundation ; either
version 3 of the License , or ( at your option ) any later version .
(declare (unit gps))
(de... | null | https://raw.githubusercontent.com/seandepagnier/cruisingplot/d3d83e7372e2c5ce1a8e8071286e30c2028088cf/gps.scm | scheme |
you can redistribute it and/or
modify it under the terms of the GNU General Public
either
This file handles reading data from a gps through libgps
open the gps host, or connect to the gpsd server
search for "GPSD," at beginning of string, and remove it or return false
hacked to turn on without DGPS
now h... | Copyright ( C ) 2009 , 2010 < >
version 3 of the License , or ( at your option ) any later version .
(declare (unit gps))
(declare (uses sensor units types utilities))
(use easyffi gl glu glut)
(include "glshortcuts.scm")
(foreign-parse "
extern int gps_stream(struct gps_data_t *gpsdata,
unsigned i... |
e5627aca25f8128d7fa8f3420757af2c91c8986c45fe2830c3074e80e2fa6c0c | SamuelYvon/Oyster | default-config.scm | ; This file serves as a template for the ~/.oyster.scm file
(add-reef "/bin") ; add /bin to the list of paths where programs can be found (it's the equivalent of PATH)
; You can set the default knife for shucking. The default knife, the butter-knife,
; will take the input literally and make an array for each line
(set... | null | https://raw.githubusercontent.com/SamuelYvon/Oyster/f16e96444cafa10b9f4410e8871c290ca45d9fdd/default-config.scm | scheme | This file serves as a template for the ~/.oyster.scm file
add /bin to the list of paths where programs can be found (it's the equivalent of PATH)
You can set the default knife for shucking. The default knife, the butter-knife,
will take the input literally and make an array for each line
Set an alias for ls to ls ... |
(set! default-knife oyster#butter-knife)
(alias 'ls 'ls "-al")
|
dcc9cce377a67fe9cb389a51e5ad0423e96478fa23401953f9ab500baa13b72d | robert-strandh/CLIMatis | clx-framebuffer-packages.lisp | (defpackage #:clim3-clx-framebuffer
(:use #:common-lisp)
(:export
))
| null | https://raw.githubusercontent.com/robert-strandh/CLIMatis/4949ddcc46d3f81596f956d12f64035e04589b29/Backends/CLX-Framebuffer/clx-framebuffer-packages.lisp | lisp | (defpackage #:clim3-clx-framebuffer
(:use #:common-lisp)
(:export
))
| |
9c256437a448f3c1304ecbc1e1903be9a6096bcc5a8a009c8637e5268c227d16 | sjl/clojurecraft | out.clj | (ns clojurecraft.out
(:use [clojurecraft.util])
(:use [clojurecraft.mappings])
(:import (java.io DataOutputStream)))
Writing Data ---------------------------------------------------------------------
(defn- -write-byte [conn i]
(io! (.writeByte ^DataOutputStream (:out @conn) (int i))))
(defn- -write-bytearr... | null | https://raw.githubusercontent.com/sjl/clojurecraft/c4f27cd3a4953c6a439b0ef9b37241fd51731083/src/clojurecraft/out.clj | clojure | TODO: Implement this.
Writing Packets ------------------------------------------------------------------
TODO: Implement this.
Writing Wrappers -----------------------------------------------------------------
Record the packet type | (ns clojurecraft.out
(:use [clojurecraft.util])
(:use [clojurecraft.mappings])
(:import (java.io DataOutputStream)))
Writing Data ---------------------------------------------------------------------
(defn- -write-byte [conn i]
(io! (.writeByte ^DataOutputStream (:out @conn) (int i))))
(defn- -write-bytearr... |
34735a6863908debbc02e9de0cba32a558f55468fa0b7085a2ec722aa37e31eb | Kappa-Dev/KappaTools | kappaLexer.mli | val compile:
Format.formatter ->
(Ast.agent, Ast.mixture, Ast.mixture, string, Ast.rule)
Ast.compil -> string -> Ast.parsing_compil
val position: Lexing.lexbuf -> string * int * int
val space_chars: char list
val reset_eof: Lexing.lexbuf -> unit
val token: Lexing.lexbuf -> KappaParser.token
| null | https://raw.githubusercontent.com/Kappa-Dev/KappaTools/5e756eb3529db9976cf0a0884a22676925985978/core/grammar/kappaLexer.mli | ocaml | val compile:
Format.formatter ->
(Ast.agent, Ast.mixture, Ast.mixture, string, Ast.rule)
Ast.compil -> string -> Ast.parsing_compil
val position: Lexing.lexbuf -> string * int * int
val space_chars: char list
val reset_eof: Lexing.lexbuf -> unit
val token: Lexing.lexbuf -> KappaParser.token
| |
6e7de33b6117ee65478d95bc99d89309a2bf49e3923e0e2deb25ea5d96bba41c | cojna/iota | RadixSpec.hs | module Data.Vector.Sort.RadixSpec (main, spec) where
import qualified Data.List as L
import Data.Vector.Sort.Radix
import qualified Data.Vector.Unboxed as U
import Data.Word
import Test.Prelude
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "radixSort32" $
prop "naive" prop_radixSort32Naive
... | null | https://raw.githubusercontent.com/cojna/iota/6d2ad5b71b1b50bca9136d6ed84f80a0b7713d7c/test/Data/Vector/Sort/RadixSpec.hs | haskell | module Data.Vector.Sort.RadixSpec (main, spec) where
import qualified Data.List as L
import Data.Vector.Sort.Radix
import qualified Data.Vector.Unboxed as U
import Data.Word
import Test.Prelude
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "radixSort32" $
prop "naive" prop_radixSort32Naive
... | |
a71295b299a943968915c42ebd6bd7426548c0010b52c3bc6358bdc993e22be4 | ddssff/cabal-debian | DebianRelations.hs | |This could be made into an instance of PropositionalFormula , but
-- it isn't yet.
# LANGUAGE FlexibleInstances , MultiParamTypeClasses , , StandaloneDeriving , TypeSynonymInstances #
# OPTIONS_GHC -fno - warn - orphans #
module Distribution.Package.Debian.DebianRelations
( toFormula
, ofFormula
) where... | null | https://raw.githubusercontent.com/ddssff/cabal-debian/763270aed987f870762e660f243451e9a34e1325/Attic/DebianRelations.hs | haskell | it isn't yet.
|There is no such thing as the True or False DebianRelation, so we
return something meaningless here - the relation is invalid because
capitalized package names "True" and "False" are invalid. Having
to implement this is evidence of a weakness in the class structure.
Turn all the ands into a list | |This could be made into an instance of PropositionalFormula , but
# LANGUAGE FlexibleInstances , MultiParamTypeClasses , , StandaloneDeriving , TypeSynonymInstances #
# OPTIONS_GHC -fno - warn - orphans #
module Distribution.Package.Debian.DebianRelations
( toFormula
, ofFormula
) where
import Debian.R... |
e5e82c8f8e645160566c31059217d820c583a8e26603038d63a4a055ffe41c14 | well-typed/large-records | R090.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE PatternSynonyms #
{-# LANGUAGE ViewPatterns #-}
#if PROFILE_CORESIZE
{-# OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #-}
#endif
#if PROFILE_TIMING
{-# OPTIONS_GHC -ddump-to-file -ddump-timings #-}
#endif
module Experiment.PatternSynonym_Default.Siz... | null | https://raw.githubusercontent.com/well-typed/large-records/c6c2b51af11e90f30822543d7ce4d1cb28cee294/large-records-benchmarks/bench/experiments/Experiment/PatternSynonym_Default/Sized/R090.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE ViewPatterns #
# OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #
# OPTIONS_GHC -ddump-to-file -ddump-timings # | # LANGUAGE PatternSynonyms #
#if PROFILE_CORESIZE
#endif
#if PROFILE_TIMING
#endif
module Experiment.PatternSynonym_Default.Sized.R090 where
import Bench.Types
data R
viewR :: R -> (
(T 00, T 01, T 02, T 03, T 04, T 05, T 06, T 07, T 08, T 09)
, (T 10, T 11, T 12, T 13, T 14, T 15, T 16, T 17, T 18, T 19... |
cf831466affa07329675175fea32919cb7f513492d0d9c148406ee45cb2f1fff | lexi-lambda/racket-tulip | ffi.rkt | #lang racket/base
(require (for-syntax racket/base
syntax/parse))
(provide curry-n)
(define-syntax-rule (curry-n n)
(λ (proc) (do-curry-n n proc ())))
(define-syntax do-curry-n
(syntax-parser
[(_ 0 proc (arg ...)) #'(proc arg ...)]
[(_ n:nat proc (arg ...)) #`(λ (x) (do-curry-n #,(s... | null | https://raw.githubusercontent.com/lexi-lambda/racket-tulip/1613cfd4d7e8dbc8ceb86cf33479375147f42b2f/tulip-lib/racket/ffi.rkt | racket | #lang racket/base
(require (for-syntax racket/base
syntax/parse))
(provide curry-n)
(define-syntax-rule (curry-n n)
(λ (proc) (do-curry-n n proc ())))
(define-syntax do-curry-n
(syntax-parser
[(_ 0 proc (arg ...)) #'(proc arg ...)]
[(_ n:nat proc (arg ...)) #`(λ (x) (do-curry-n #,(s... | |
e3f14751dbbad6fd3ccf22e2ab90a39ce61d1a3694907177f666eadb3cddbb06 | YoshikuniJujo/funpaala | foldable.hs | import Data.Monoid (Sum(..), Product(..), Any(..), Endo(..))
lelem :: Eq a => a -> [a] -> Bool
lelem x (y : ys) = y `op` lelem x ys
where op = (||) . (== x)
lelem _ [] = False
lsum :: Num a => [a] -> a
lsum (x : xs) = x + lsum xs
lsum [] = 0
lproduct :: Num a => [a] -> a
lproduct (x : xs) = x * lproduct xs
lproduct... | null | https://raw.githubusercontent.com/YoshikuniJujo/funpaala/5366130826da0e6b1180992dfff94c4a634cda99/samples/41_foldable/foldable.hs | haskell | import Data.Monoid (Sum(..), Product(..), Any(..), Endo(..))
lelem :: Eq a => a -> [a] -> Bool
lelem x (y : ys) = y `op` lelem x ys
where op = (||) . (== x)
lelem _ [] = False
lsum :: Num a => [a] -> a
lsum (x : xs) = x + lsum xs
lsum [] = 0
lproduct :: Num a => [a] -> a
lproduct (x : xs) = x * lproduct xs
lproduct... | |
e04a07db8fd3875337f56d12609fe347880e318be445330b2864c436491f630b | sebsheep/elm2node | Binop.hs | # OPTIONS_GHC -Wall #
module AST.Utils.Binop
( Precedence(..)
, Associativity(..)
)
where
import Prelude hiding (Either(..))
import Control.Monad (liftM)
import Data.Binary
STUFF
newtype Precedence = Precedence Int
deriving (Eq, Ord)
data Associativity
= Left
| Non
| Right
deriving (Eq)
... | null | https://raw.githubusercontent.com/sebsheep/elm2node/602a64f48e39edcdfa6d99793cc2827b677d650d/compiler/src/AST/Utils/Binop.hs | haskell | BINARY | # OPTIONS_GHC -Wall #
module AST.Utils.Binop
( Precedence(..)
, Associativity(..)
)
where
import Prelude hiding (Either(..))
import Control.Monad (liftM)
import Data.Binary
STUFF
newtype Precedence = Precedence Int
deriving (Eq, Ord)
data Associativity
= Left
| Non
| Right
deriving (Eq)
... |
71a2104e63d468bb59a921aeb8eb00160d10508ad2ba95e04a61dadb5a43dd05 | stuarthalloway/practical-cl-clojure | test.clj | (ns test
(:use clojure.test))
(def tests
['pcl.chap-03-test])
(doseq [test tests] (require test))
(apply run-tests tests)
(shutdown-agents) | null | https://raw.githubusercontent.com/stuarthalloway/practical-cl-clojure/eaa8af4eabdeae55cd10eff357be94b8e06969d8/test/test.clj | clojure | (ns test
(:use clojure.test))
(def tests
['pcl.chap-03-test])
(doseq [test tests] (require test))
(apply run-tests tests)
(shutdown-agents) | |
572572e1b40403fa36de5b91985568453ed6862e64e3e99a4bf81ec5042bd313 | sondresl/AdventOfCode | Day10.hs | module Day10 where
import Prelude hiding (lookup)
import Data.List.Extra hiding (lookup)
import Data.Maybe
import Data.Map.Strict (Map, lookup)
import Data.Tuple.Extra
import qualified Data.Map.Strict as M
type Data = Map Asteroid Distance
type Asteroid = (Int, Int)
type Distance = Int
coords :: [String] -> Data
coo... | null | https://raw.githubusercontent.com/sondresl/AdventOfCode/51525441795417f31b3eb67a690aa5534d1e699b/2019/Haskell/src/Day10.hs | haskell | module Day10 where
import Prelude hiding (lookup)
import Data.List.Extra hiding (lookup)
import Data.Maybe
import Data.Map.Strict (Map, lookup)
import Data.Tuple.Extra
import qualified Data.Map.Strict as M
type Data = Map Asteroid Distance
type Asteroid = (Int, Int)
type Distance = Int
coords :: [String] -> Data
coo... | |
0a9d45acd9474ec9b51029de34c8cc0ad528d8ceedad592a3eefe8a5d0839301 | aantron/dream | error.eml.ml | let my_error_template _error debug_info suggested_response =
let status = Dream.status suggested_response in
let code = Dream.status_to_int status
and reason = Dream.status_to_string status in
Dream.set_header suggested_response "Content-Type" Dream.text_html;
Dream.set_body suggested_response begin
<htm... | null | https://raw.githubusercontent.com/aantron/dream/a680f4be417ea4d6f085a4d6e0baadba31adad7d/example/9-error/error.eml.ml | ocaml | let my_error_template _error debug_info suggested_response =
let status = Dream.status suggested_response in
let code = Dream.status_to_int status
and reason = Dream.status_to_string status in
Dream.set_header suggested_response "Content-Type" Dream.text_html;
Dream.set_body suggested_response begin
<htm... | |
4486ccd98237cdc2949b72ab6063b1c0a452dfddddbd585e45185d46f30794c9 | brendanhay/gogol | List.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE St... | null | https://raw.githubusercontent.com/brendanhay/gogol/fffd4d98a1996d0ffd4cf64545c5e8af9c976cda/lib/services/gogol-tagmanager/gen/Gogol/TagManager/Accounts/Containers/Workspaces/Triggers/List.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
/See:/ <-manager Tag Manager API Reference> for @tagmanager.accounts.containers.workspaces.triggers.list@.
* Resource
** Constructing a Request
'TagManagerAccountsContainersWorkspacesTriggersList' request conforms to.
/See:/... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
8396104919fc35b8040c9f2d6d6cbc1ffeab5777d71a1ef63df9c39bd0e28e37 | sdiehl/elliptic-curve | Curve.hs | module Generate.Weierstrass.Curve
( prettyCurve
) where
import Protolude
import Text.PrettyPrint.Leijen.Text
import Generate.Curve
import Generate.Pretty
import Generate.Weierstrass.Types
-------------------------------------------------------------------------------
-- Curve
-----------------------------------... | null | https://raw.githubusercontent.com/sdiehl/elliptic-curve/445e196a550e36e0f25bd4d9d6a38676b4cf2be8/generate/Generate/Weierstrass/Curve.hs | haskell | -----------------------------------------------------------------------------
Curve
----------------------------------------------------------------------------- | module Generate.Weierstrass.Curve
( prettyCurve
) where
import Protolude
import Text.PrettyPrint.Leijen.Text
import Generate.Curve
import Generate.Pretty
import Generate.Weierstrass.Types
prettyImports :: Text -> Types -> Doc
prettyImports name Types{..}
= "module Data.Curve.Weierstrass." <> pretty name
... |
2a502a7ab551f2c28fec3372dd27c13c5d69ff8e1cba552c8f1a7bb3bdf04222 | Soyn/sicp | Ex2.73.rkt | #lang racket
;Ex2.73
Created by . 21/7/15
;---------------Help Fuction---------------
PS : Assume get / put procedurehas existed ..
( define ( type-tag datum)
( if ( pair? datum)
( car datum)
( error " Bad tagged datum -- TYPE-TAG" datum)))
( define ( attach-tag type-tag contents)
( cons type-t... | null | https://raw.githubusercontent.com/Soyn/sicp/d2aa6e3b053f6d4c8150ab1b033a18f61fca7e1b/CH2/CH2.4/Ex2.73.rkt | racket | Ex2.73
---------------Help Fuction---------------
------------------------------------------------
b solutions:
put the deriv into the dispatch
c solution: | #lang racket
Created by . 21/7/15
PS : Assume get / put procedurehas existed ..
( define ( type-tag datum)
( if ( pair? datum)
( car datum)
( error " Bad tagged datum -- TYPE-TAG" datum)))
( define ( attach-tag type-tag contents)
( cons type-tag contents))
( define ( apply-generic op args)
... |
98bd36894b4d0c23e759b85c08289570b69633381fb1be73be368c3fa417bd09 | np/hlatex | Rotating.hs | module Language.LaTeX.Builder.Rotating (pkg, turn) where
import Language.LaTeX.Types
import qualified Language.LaTeX.Builder.Internal as BI
pkg :: PackageName
pkg = BI.pkgName "rotating"
turn :: Int -> LatexItem -> LatexItem
turn i = BI.latexEnvironment "turn" [BI.packageDependency pkg, BI.mandatory (BI.num i)]
| null | https://raw.githubusercontent.com/np/hlatex/4f2212c5db5e10dab7f6cbb9cf47a041b3320176/Language/LaTeX/Builder/Rotating.hs | haskell | module Language.LaTeX.Builder.Rotating (pkg, turn) where
import Language.LaTeX.Types
import qualified Language.LaTeX.Builder.Internal as BI
pkg :: PackageName
pkg = BI.pkgName "rotating"
turn :: Int -> LatexItem -> LatexItem
turn i = BI.latexEnvironment "turn" [BI.packageDependency pkg, BI.mandatory (BI.num i)]
| |
f286cca1e4004c6fbd2fdf20b1a776dea9a73e101bafd539443b45ed125a2ce4 | RefactoringTools/HaRe | HsGuardsStruct.hs | {-# LANGUAGE DeriveDataTypeable #-}
$ I d : HsGuardsStruct.hs , v 1.1 2001/07/25 01:15:30 moran Exp $
module HsGuardsStruct where
import Data.Generics
import SrcLoc1
data HsAlt e p ds
= HsAlt SrcLoc p (HsRhs e) {-where-} ds
deriving (Ord,Read, Eq, Show, Data, Typeable)
data HsRhs e
= HsBody e
... | null | https://raw.githubusercontent.com/RefactoringTools/HaRe/ef5dee64c38fb104e6e5676095946279fbce381c/old/tools/base/AST/HsGuardsStruct.hs | haskell | # LANGUAGE DeriveDataTypeable #
where | $ I d : HsGuardsStruct.hs , v 1.1 2001/07/25 01:15:30 moran Exp $
module HsGuardsStruct where
import Data.Generics
import SrcLoc1
data HsAlt e p ds
deriving (Ord,Read, Eq, Show, Data, Typeable)
data HsRhs e
= HsBody e
| HsGuard [(SrcLoc, e, e)]
deriving (Ord,Read, Eq, Show, Data, Typeable)
|
a1f4f3f9248d35e85e482902309518dcc50cdd4253423cb4d1822c54aec45148 | brendanhay/amazonka | CreateCustomMetadata.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE StrictData #-}
# LANGUAGE TypeFamilies #
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - binds #
# OPTIONS_GHC -fno - warn - unused -... | null | https://raw.githubusercontent.com/brendanhay/amazonka/09f52b75d2cfdff221b439280d3279d22690d6a6/lib/services/amazonka-workdocs/gen/Amazonka/WorkDocs/CreateCustomMetadata.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Module : Amazonka.WorkDocs.CreateCustomMetadata
Stability : auto-generated
document, or version).
* Creating a Request
* Request Lenses
* Destructuring the Response
* Response Lenses
| /See:/ 'newCreateCustomMetadata' smart constructor.
administ... | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - binds #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - unused - matches #
De... |
606d68967d42820fcdc1d7db1c573e812db9adea63e4ff0121330f42949ad70e | graninas/Hydra | FTL.hs | {-# LANGUAGE GADTs #-}
# LANGUAGE TemplateHaskell #
module Hydra.Core.Logger.FTL where
import Hydra.Prelude
import qualified Hydra.Core.Domain as D
class Monad m => LoggerL m where
logMessage :: D.LogLevel -> D.Message -> m ()
-- -- class Logger m => StmLoggerL m where
-- -- logMessage :: ... | null | https://raw.githubusercontent.com/graninas/Hydra/60d591b1300528f5ffd93efa205012eebdd0286c/lib/hydra-free/src/Hydra/Core/Logger/FTL.hs | haskell | # LANGUAGE GADTs #
-- class Logger m => StmLoggerL m where
-- logMessage :: D.LogLevel -> D.Message -> STM ()
| Log message with Info level.
| Log message with Error level.
| Log message with Debug level.
| Log message with Warning level. | # LANGUAGE TemplateHaskell #
module Hydra.Core.Logger.FTL where
import Hydra.Prelude
import qualified Hydra.Core.Domain as D
class Monad m => LoggerL m where
logMessage :: D.LogLevel -> D.Message -> m ()
logInfo :: LoggerL m => D.Message -> m ()
logInfo = logMessage D.Info
logError :: LoggerL m => ... |
7f301546ebe80a8bf483996aed95ae6b91f76560284fdc785bef69bf2e7cad7d | takikawa/tr-pfds | binary-ran-access-list-tests.rkt | #lang typed/scheme
(require (prefix-in rk: racket/base))
(require pfds/ralist/binary)
(require typed/test-engine/scheme-tests)
(check-expect (head (list 1 2 3 4 5 6 7)) 1)
(check-expect (head (list "" "")) "")
(check-expect (tail (list 1)) (list))
(check-expect (head (tail (list 1 2 3 4 5 6 7))) 2)
(check-expect (emp... | null | https://raw.githubusercontent.com/takikawa/tr-pfds/a08810bdfc760bb9ed68d08ea222a59135d9a203/pfds/tests/binary-ran-access-list-tests.rkt | racket | #lang typed/scheme
(require (prefix-in rk: racket/base))
(require pfds/ralist/binary)
(require typed/test-engine/scheme-tests)
(check-expect (head (list 1 2 3 4 5 6 7)) 1)
(check-expect (head (list "" "")) "")
(check-expect (tail (list 1)) (list))
(check-expect (head (tail (list 1 2 3 4 5 6 7))) 2)
(check-expect (emp... | |
ef8e6ec745b507efc7e019bc9c30d7e2cf4cac126ea96f5520136d2b600ed7a0 | basho-labs/fling | fling_app.erl | -module(fling_app).
-behaviour(application).
-export([
start/2,
stop/1
]).
start(_App, _Type) ->
fling_sup:start_link().
stop(_) -> ok.
| null | https://raw.githubusercontent.com/basho-labs/fling/b6e25809f43b73461cc23d33d17b1e4f106b9cb3/src/fling_app.erl | erlang | -module(fling_app).
-behaviour(application).
-export([
start/2,
stop/1
]).
start(_App, _Type) ->
fling_sup:start_link().
stop(_) -> ok.
| |
dde42adfa32ad2b4903f1d9b8d8d9e40a0aa8ae3dd546357dc94826ac8d87a39 | csabahruska/p4f-control-flow-analysis | HCFA.hs | # LANGUAGE LambdaCase , RecordWildCards , TupleSections #
module HCFA where
interpreter for abstract semantics
H - CFA : a Simplified Approach for Pushdown Control Flow Analysis
interpreter for abstract semantics
H-CFA: a Simplified Approach for Pushdown Control Flow Analysis
-}
import Control... | null | https://raw.githubusercontent.com/csabahruska/p4f-control-flow-analysis/1bea3e07a5e5c546a6d8e74a1b84cc4f4487100d/HCFA.hs | haskell |
INVARIANTS:
- globally unique names
Lit{} -> [(exp, aamState)]
[(exp, aamState)]
atomic expression
global store widening
value allocators
kontinuation allocators
examples
pretty address conversion | # LANGUAGE LambdaCase , RecordWildCards , TupleSections #
module HCFA where
interpreter for abstract semantics
H - CFA : a Simplified Approach for Pushdown Control Flow Analysis
interpreter for abstract semantics
H-CFA: a Simplified Approach for Pushdown Control Flow Analysis
-}
import Control... |
3bf2e28d1ccad8b3b6e26dc74c89bbd200081f52980e17d8813d08f6c893c96e | typelead/etlas | Program.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE RankNTypes #-}
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.Program
Copyright : 2006 , 2007 - 2009
--
-- Maintainer :
-- Portability : portable
--
-- This provides an abstraction which ... | null | https://raw.githubusercontent.com/typelead/etlas/bbd7c558169e1fda086e759e1a6f8c8ca2807583/etlas-cabal/Distribution/Simple/Program.hs | haskell | # LANGUAGE RankNTypes #
---------------------------------------------------------------------------
|
Module : Distribution.Simple.Program
Maintainer :
Portability : portable
This provides an abstraction which deals with configuring and running
programs. A 'Program' is a static notion of a known progr... | # LANGUAGE FlexibleContexts #
Copyright : 2006 , 2007 - 2009
finding its version . There is also a ' ProgramDb ' type which holds
actions elsewhere in Cabal that need to look up and run programs . If we had
a Cabal monad , the ' ProgramDb ' would probably be a reader or
The module also defines all t... |
1633ed8b3c316121fb618ec76617cdd6bcbce5593261cbf0ecc899ee5c1e6e70 | berke/aurochs | rgb.ml | (* Rgb *)
Copyright ( C)2000 - 2006
Released under the GNU Lesser General Public License version 2.1
type t = float * float * float
let mix alpha (r1,g1,b1) (r2,g2,b2) =
let f x y = (1.0 -. alpha) *. x +. alpha *. y
in
(f r1 r2, f g1 g2, f b1 b2)
let add (r1,g1,b1) (r2,g2,b... | null | https://raw.githubusercontent.com/berke/aurochs/637bdc0d4682772837f9e44112212e7f20ab96ff/examples/cgidemo/rgb.ml | ocaml | Rgb | Copyright ( C)2000 - 2006
Released under the GNU Lesser General Public License version 2.1
type t = float * float * float
let mix alpha (r1,g1,b1) (r2,g2,b2) =
let f x y = (1.0 -. alpha) *. x +. alpha *. y
in
(f r1 r2, f g1 g2, f b1 b2)
let add (r1,g1,b1) (r2,g2,b2) =
let... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.