_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 |
|---|---|---|---|---|---|---|---|---|
438931e73cc70d1ffbcf86484f19acd357615fa855455643da35ad51bbde604a | NathanReb/ppx_yojson | expr_unsupported_payload.ml | let unsupported_payload = [%yojson Ok ()]
| null | https://raw.githubusercontent.com/NathanReb/ppx_yojson/085844cbbbc199689faeeee0c9bc1f4d9bc5f4f9/test/rewriter/errors/expr_unsupported_payload.ml | ocaml | let unsupported_payload = [%yojson Ok ()]
| |
ef60193387217db4dbb5aa8ff02f4b69376a2d1cffd080408963b61555e8d874 | sboehler/beans | Open.hs | module Beans.Open (Open (Open)) where
import Beans.Account (Account)
import Beans.Date (Date)
import Data.Text.Prettyprint.Doc (Pretty (pretty), (<+>))
data Open
= Open
Date
Account
deriving (Eq, Show, Ord)
instance Pretty Open where
pretty (Open d a) =
pretty d <+> "open" <+> pretty a
| null | https://raw.githubusercontent.com/sboehler/beans/897fc30a602f49906eb952c4fd5c8c0bf05a6beb/src/Beans/Open.hs | haskell | module Beans.Open (Open (Open)) where
import Beans.Account (Account)
import Beans.Date (Date)
import Data.Text.Prettyprint.Doc (Pretty (pretty), (<+>))
data Open
= Open
Date
Account
deriving (Eq, Show, Ord)
instance Pretty Open where
pretty (Open d a) =
pretty d <+> "open" <+> pretty a
| |
707bcb7129dcfa02fc3c3aa51593ab5fcabf8297d3782efc750d8b9411f7337d | bytekid/mkbtt | statistics.mli | Copyright 2010
* GNU Lesser General Public License
*
* This file is part of MKBtt .
*
* 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 License , or (... | null | https://raw.githubusercontent.com/bytekid/mkbtt/c2f8e0615389b52eabd12655fe48237aa0fe83fd/src/mascott/src/statistics.mli | ocaml | ** VALUES ************************************************************ | Copyright 2010
* GNU Lesser General Public License
*
* This file is part of MKBtt .
*
* 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 License , or (... |
50b6b3a333db343b27ea7629ef8da73a24a551e3e6712bf4bed35acd42d32a8d | zenhack/haskell-capnp | Rc.hs | # LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
-- |
-- Module: Internal.Rc
-- Description: Reference counted boxes.
--
-- This module provides a reference-counted cell type 'Rc', which contains a
value and a finalizer . When the reference count reaches zero , the value is
-- dropped and the finalizer is run.
mo... | null | https://raw.githubusercontent.com/zenhack/haskell-capnp/6cf9fae35189a3668f2740d64c634675ec5fbdec/lib/Internal/Rc.hs | haskell | |
Module: Internal.Rc
Description: Reference counted boxes.
This module provides a reference-counted cell type 'Rc', which contains a
dropped and the finalizer is run.
| @'new' val finalizer@ creates a new 'Rc' containing the value @val@, with
finalizer will be run.
| Increment the reference count.
finalizer ... | # LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
value and a finalizer . When the reference count reaches zero , the value is
module Internal.Rc
( Rc,
new,
get,
incr,
decr,
release,
)
where
import Control.Concurrent.STM
| A reference - counted container for a value of type
newtype Rc ... |
fde1207b5d0f8d8aa0002eb5ca7d5df779cc7dad4504931b890da491286d0ea4 | tolitius/grete | java_api.clj | (ns grete.java-api
(:require [clojure.edn :as edn]
[clojure.tools.logging :as log]
[clojure.walk :refer [keywordize-keys]]
[grete.tools :as t]
[grete.core :as g])
(:import [org.apache.kafka.clients.consumer KafkaConsumer
C... | null | https://raw.githubusercontent.com/tolitius/grete/c1b6a470661668dace269f80cfbe13a4fe8eb50f/src/grete/java_api.clj | clojure | (ns grete.java-api
(:require [clojure.edn :as edn]
[clojure.tools.logging :as log]
[clojure.walk :refer [keywordize-keys]]
[grete.tools :as t]
[grete.core :as g])
(:import [org.apache.kafka.clients.consumer KafkaConsumer
C... | |
56ec88ff17c47062bfa6626c080690e54b11e9334116b41701e872427a4e0507 | godfat/sandbox | fib2.hs |
module Fib2 where
fibs = 0 : 1 : [ x + y | (x, y) <- zip fibs (tail fibs)]
fib :: Int -> Int
fib n = fib' id n where
fib' f n | n < 2 = f n
fib' f n = fib' (\v -> fib' (\m -> v + f m) (n-2)) (n-1)
--
mydrop :: Int -> [a] -> [a]
mydrop 0 xs = xs
mydrop (n+1) (x:xs) = mydrop n xs
| null | https://raw.githubusercontent.com/godfat/sandbox/eb6294238f92543339adfdfb4ba88586ba0e82b8/mix/benchmark/fib2.hs | haskell |
module Fib2 where
fibs = 0 : 1 : [ x + y | (x, y) <- zip fibs (tail fibs)]
fib :: Int -> Int
fib n = fib' id n where
fib' f n | n < 2 = f n
fib' f n = fib' (\v -> fib' (\m -> v + f m) (n-2)) (n-1)
mydrop :: Int -> [a] -> [a]
mydrop 0 xs = xs
mydrop (n+1) (x:xs) = mydrop n xs
| |
ff73e9486fbb295264a7d8fdefaab5f908d44c874442ccff4c7e8fa8cde516c2 | PESchoenberg/g2q | example1.scm | #! /usr/local/bin/guile -s
!#
;; =============================================================================
;;
;; example1.scm
;;
A sample of different gates and functions of g2q . Note that this program does
;; not intend to be a functional one. It is just a way to demostrate what gates
;; and functions you can... | null | https://raw.githubusercontent.com/PESchoenberg/g2q/8b971d9e5073ab9f1ccd1b7bbce07e95eb4fefee/examples/example1.scm | scheme | =============================================================================
example1.scm
not intend to be a functional one. It is just a way to demostrate what gates
and functions you can write and how. Don't worry about the sense it doesn't
make as a practical program.
===================================... | #! /usr/local/bin/guile -s
!#
A sample of different gates and functions of g2q . Note that this program does
Copyright ( C ) 2018 - 2022 Pablo Edronkin ( pablo.edronkin at yahoo.com )
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU Lesser Gene... |
9ccb2623420194d0da0811e16e75b290076ba77afe87a51846e1d4fb152837fd | aprell/compiler-potpourri | basic_block.ml | open Three_address_code__IR
open Three_address_code__Utils
open Utils
type t = {
name : string;
number : int;
mutable stmts : stmt ref list;
mutable pred : t list;
mutable succ : t list;
}
let block_number = gen_number 1
(* Constructor for basic blocks *)
let create ?name ?(number = block_number ()) ?(stmt... | null | https://raw.githubusercontent.com/aprell/compiler-potpourri/7c0ba9b229c6019d35f732ada0618ac1a13ae003/basic_blocks/basic_block.ml | ocaml | Constructor for basic blocks
Extend basic block
End previous basic block
Insert explicit jump
This line starts a new basic block
End current basic block
Extend basic block
Close open basic block
Insert explicit return
Remove x from use, then add all variables that occur in e
Add x to def, then remo... | open Three_address_code__IR
open Three_address_code__Utils
open Utils
type t = {
name : string;
number : int;
mutable stmts : stmt ref list;
mutable pred : t list;
mutable succ : t list;
}
let block_number = gen_number 1
let create ?name ?(number = block_number ()) ?(stmts = []) () =
{ name = Option.valu... |
9db8c52cd8a0a6bc9c6bf06e2a2810c1d17b30881d2d79c2ac950f947e351343 | sixohsix/tak | GotoLine.hs | module Tak.GotoLine (gotoLine) where
import Data.Maybe (fromMaybe)
import Control.Lens (set, over, view)
import Tak.Types
import Tak.RunLoop (query)
import Tak.Buffer
import Tak.Editor.Cursor (fixScroll)
gotoLine :: GlobalState -> IO GlobalState
gotoLine gst = do
lineNoStr <- query "Go to which line?" gst
retur... | null | https://raw.githubusercontent.com/sixohsix/tak/6310d19faa683156933dde38666c11dc087d79ea/src/Tak/GotoLine.hs | haskell | module Tak.GotoLine (gotoLine) where
import Data.Maybe (fromMaybe)
import Control.Lens (set, over, view)
import Tak.Types
import Tak.RunLoop (query)
import Tak.Buffer
import Tak.Editor.Cursor (fixScroll)
gotoLine :: GlobalState -> IO GlobalState
gotoLine gst = do
lineNoStr <- query "Go to which line?" gst
retur... | |
49c1e1eb224a06d84c463ce6c3d20fa6ea986a3cd47e10f4f7997d28cfe7200c | Tim-ats-d/Postem-markup | postem.ml | let () = Postem__Compiler.compile ()
| null | https://raw.githubusercontent.com/Tim-ats-d/Postem-markup/8a099c2fe56a57130fcfb7b5328b1d1890b104e3/bin/postem.ml | ocaml | let () = Postem__Compiler.compile ()
| |
ba4520a67d5dbf3f07b50b37a3678c005b2c162e5d5926a5f39d1556700339d2 | yesodweb/yesod | PasswordStore.hs | # LANGUAGE OverloadedStrings , BangPatterns #
# LANGUAGE CPP #
-- |
This is a fork of pwstore - fast , originally copyright ( c ) , 2011 ,
-- and released under a BSD-style licence.
--
-- Securely store hashed, salted passwords. If you need to store and verify
-- passwords, there are many wrong ways to do it, most ... | null | https://raw.githubusercontent.com/yesodweb/yesod/c59993ff287b880abbf768f1e3f56ae9b19df51e/yesod-auth/Yesod/Auth/Util/PasswordStore.hs | haskell | |
and released under a BSD-style licence.
Securely store hashed, salted passwords. If you need to store and verify
passwords, there are many wrong ways to do it, most of them all too
common. Some people store users' passwords in plain text. Then, when an
attacker manages to get their hands on this file, they hav... | # LANGUAGE OverloadedStrings , BangPatterns #
# LANGUAGE CPP #
This is a fork of pwstore - fast , originally copyright ( c ) , 2011 ,
every user 's account . One step up , but still wrong , is to simply hash all
passwords with or something . This is vulnerable to rainbow table and
dictionary attacks . One st... |
51d6c99ead7e38bc6e2f351f0705885b3b2d8c523b9c974331df42581ff5ce61 | pingles/googlecloud | tabledata.clj | (ns googlecloud.bigquery.tabledata
(:import [com.google.api.services.bigquery Bigquery Bigquery$Tabledata]
[com.google.api.services.bigquery.model Table TableDataInsertAllRequest TableDataInsertAllRequest$Rows TableRow])
(:require [schema.core :as s]))
(defmulti mk-table-row (fn [row]
... | null | https://raw.githubusercontent.com/pingles/googlecloud/8d31afb1c627d40f7293f85c479cbfa98317b056/bigquery/src/googlecloud/bigquery/tabledata.clj | clojure | (ns googlecloud.bigquery.tabledata
(:import [com.google.api.services.bigquery Bigquery Bigquery$Tabledata]
[com.google.api.services.bigquery.model Table TableDataInsertAllRequest TableDataInsertAllRequest$Rows TableRow])
(:require [schema.core :as s]))
(defmulti mk-table-row (fn [row]
... | |
a0047d556ff62776c29a2635014f63f5b46a40dd553b5e75e871e4d92a3e0212 | ryanpbrewster/haskell | P112Test.hs | module Problems.P112Test
( case_112_main
) where
import Problems.P112
import Test.Tasty.Discover (Assertion, (@?=))
case_112_main :: Assertion
case_112_main = solve @?= "233168"
| null | https://raw.githubusercontent.com/ryanpbrewster/haskell/6edd0afe234008a48b4871032dedfd143ca6e412/project-euler/tests/Problems/P112Test.hs | haskell | module Problems.P112Test
( case_112_main
) where
import Problems.P112
import Test.Tasty.Discover (Assertion, (@?=))
case_112_main :: Assertion
case_112_main = solve @?= "233168"
| |
1a850b06c1e6f99e31f702c388bb719e6fe3389e8d0d23acb10fb70fa1f94a6b | MarcusPlieninger/HtDP_2e_solutions | HtDP_2e_Exercise_017.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname HtDP_2e_Exercise_17) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib... | null | https://raw.githubusercontent.com/MarcusPlieninger/HtDP_2e_solutions/1b25b01ee950034c43cc9a907c4eabae2b5e4dbc/HtDP_2e_Exercise_017.rkt | racket | about the language level of this file in a form that our tools can easily process.
produces "tall" if the image is taller than wide, "wide" if it is wider than tall, or "square" | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname HtDP_2e_Exercise_17) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt" "teachpack" "2htdp"))) (htdp-settings #(#t constructor repeating-decim... |
5e7621630a2006716b226ecdda452769c2b9bff214b0fa0b6605ec4369d3cc66 | alanz/ghc-exactprint | pmc002.hs | # OPTIONS_GHC -fwarn - incomplete - patterns -fwarn - overlapping - patterns #
module PMC002 where
f :: [a] -> Bool
f [] = True
f x | (_:_) <- x = False -- exhaustive
| null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc80/pmc002.hs | haskell | exhaustive | # OPTIONS_GHC -fwarn - incomplete - patterns -fwarn - overlapping - patterns #
module PMC002 where
f :: [a] -> Bool
f [] = True
|
55dc8786014c0e919ae187e69a41e74bf27f32d34a1491a68487422e06c5b349 | samply/blaze | measure_test.clj | (ns blaze.fhir.operation.evaluate-measure.measure-test
(:require
[blaze.db.api :as d]
[blaze.db.api-stub :refer [mem-node-system with-system-data]]
[blaze.fhir.operation.evaluate-measure.measure :as measure]
[blaze.fhir.operation.evaluate-measure.measure-spec]
[blaze.fhir.operation.evaluate-measur... | null | https://raw.githubusercontent.com/samply/blaze/948eee38021467fa343c522a644a7fd4b24b6467/modules/operation-measure-evaluate-measure/test/blaze/fhir/operation/evaluate_measure/measure_test.clj | clojure | (ns blaze.fhir.operation.evaluate-measure.measure-test
(:require
[blaze.db.api :as d]
[blaze.db.api-stub :refer [mem-node-system with-system-data]]
[blaze.fhir.operation.evaluate-measure.measure :as measure]
[blaze.fhir.operation.evaluate-measure.measure-spec]
[blaze.fhir.operation.evaluate-measur... | |
f42e22796721a5acb0f63f9e2272a4d9e14b44268fcc7aa16daf440be1df6898 | marigold-dev/deku | instance.ml | open Types
module Out_of_gas = Error.Make ()
exception Out_of_gas = Out_of_gas.Error
type module_inst = {
types : func_type list;
funcs : func_inst list;
tables : table_inst list;
memories : memory_inst list;
globals : global_inst list;
exports : export_inst list;
elems : elem_inst list;
datas : data_... | null | https://raw.githubusercontent.com/marigold-dev/deku/a26f31e0560ad12fd86cf7fa4667bb147247c7ef/deku-c/interpreter/runtime/instance.ml | ocaml | Reference types
Auxiliary functions | open Types
module Out_of_gas = Error.Make ()
exception Out_of_gas = Out_of_gas.Error
type module_inst = {
types : func_type list;
funcs : func_inst list;
tables : table_inst list;
memories : memory_inst list;
globals : global_inst list;
exports : export_inst list;
elems : elem_inst list;
datas : data_... |
f131bac060f433c8c65783f781ee7efa8259f6566f96f0ead9c71fbbb8f445d2 | Mercerenies/eulers-melting-pot | chgen.lisp |
(defparameter *loop-counter*
0)
(defun identify-vars (x)
(typecase x
(symbol (list x))
(integer (list x))
(list (mapcan #'identify-vars (cdr x)))
(t ())))
(defun replace-var (x a b)
(typecase x
(symbol (if (eql x a) b x))
(integer (if (eql x a) b x))
(list (if (eql (c... | null | https://raw.githubusercontent.com/Mercerenies/eulers-melting-pot/68bcb9b1d46278c0bab4ab6200bcba09be8e4930/etc/chgen.lisp | lisp | (mov src dest)
(if g . body)
(forever . body)
(return g)
(push g (n))
(pop g (n))
(add g (n))
(sub g (n))
(div g (n))
(roll (n) x)
(clear (n))
(pprint (n))
(do-loop g.body)
(for-loop g.body)
(last)
(call sub)
(exit)
(name . body)
(solns perimeter)
(negate n)
(is-positive n)
|
(defparameter *loop-counter*
0)
(defun identify-vars (x)
(typecase x
(symbol (list x))
(integer (list x))
(list (mapcan #'identify-vars (cdr x)))
(t ())))
(defun replace-var (x a b)
(typecase x
(symbol (if (eql x a) b x))
(integer (if (eql x a) b x))
(list (if (eql (c... |
bb3b3951718f657404e0ed8ac0d1eaf8768a23ceebe49cdc197739f537caf514 | bmeurer/ocaml-arm | map.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/bmeurer/ocaml-arm/43f7689c76a349febe3d06ae7a4fc1d52984fd8b/stdlib/map.ml | ocaml | *********************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
$ Id$
module type OrderedType =
si... |
86a09a1132054f0c2028468b6359332ffc5a98f4eaf965f69fed3eb8c07288ba | basti1302/elm-lang-de | Util.hs | {-# LANGUAGE OverloadedStrings #-}
module AccessToken.Util
( accessTokenToCookie
, deleteAccessTokenCookie
, readAccessTokenFromCookieHeader
, readAccessTokenFromRequest
) where
import qualified Util.Config as Config
import Control.Applicative
import qualified Data.Binary.Builder
import... | null | https://raw.githubusercontent.com/basti1302/elm-lang-de/9654752fb6fb56bc4116483f3bbd412a774e9fb1/backend/app/AccessToken/Util.hs | haskell | # LANGUAGE OverloadedStrings #
days
hours
minutes
seconds |
module AccessToken.Util
( accessTokenToCookie
, deleteAccessTokenCookie
, readAccessTokenFromCookieHeader
, readAccessTokenFromRequest
) where
import qualified Util.Config as Config
import Control.Applicative
import qualified Data.Binary.Builder
import qualified Data.ByteString.Char8 as... |
ecf1773f6acbb23e714cc18c877e98c420a88f2a4c96b73be6c5f65dc88e8092 | janestreet/universe | vcaml.mli | open! Core
open Async
module Internal = Nvim_internal
module Client_info = Client_info
module Channel_info = Channel_info
module Nvim_command = Nvim_command
module Keymap = Keymap
module Buf = Buf
module Window = Window
module Tabpage = Tabpage
module Client : sig
include module type of Client
type t = Types.clie... | null | https://raw.githubusercontent.com/janestreet/universe/b6cb56fdae83f5d55f9c809f1c2a2b50ea213126/vcaml/src/vcaml.mli | ocaml | * A value of type [Connection_type.t] describes the type of connection to
use, along with the information necessary to construct the [Msgpack_rpc]
channel.
* Contains a getter and setter for a given variable or property.
* A [Defun.Vim.t] value is a reified value corresponding to the type of
a funct... | open! Core
open Async
module Internal = Nvim_internal
module Client_info = Client_info
module Channel_info = Channel_info
module Nvim_command = Nvim_command
module Keymap = Keymap
module Buf = Buf
module Window = Window
module Tabpage = Tabpage
module Client : sig
include module type of Client
type t = Types.clie... |
e6071a1580e9b91e67efedfa7d3639556a3fa1285ab57febe0e6cd60bc8a4d73 | Relph1119/sicp-solutions-manual | p34-fermat-test.scm | (load "src/examples/ch01/p34-expmod.scm")
(define (fermat-test n)
(define (try-it a)
(= (expmod a n n) a))
(try-it (+ 1 (random (- n 1))))) | null | https://raw.githubusercontent.com/Relph1119/sicp-solutions-manual/f2ff309a6c898376209c198030c70d6adfac1fc1/src/examples/ch01/p34-fermat-test.scm | scheme | (load "src/examples/ch01/p34-expmod.scm")
(define (fermat-test n)
(define (try-it a)
(= (expmod a n n) a))
(try-it (+ 1 (random (- n 1))))) | |
316922a83d8a8a0e185099e64250916a5c284dfba5fc6e922ce317a182ed0a79 | ocamllabs/ocaml-effects | set.mli | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-effects/36008b741adc201bf9b547545344507da603ae31/stdlib/set.mli | ocaml | *********************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
* Sets over ordered types .
This ... |
bcccc1c457089ff936f3a8e8d5047ec01c3bf054255eaa30e06c1e918808b1e5 | didierverna/tfm | readtable.lisp | readtable.lisp --- TFM readtable management
Copyright ( C ) 2019 , 2021
Author : < >
This file is part of TFM .
;; Permission to use, copy, modify, and distribute this software for any
;; purpose with or without fee is hereby granted, provided that the above
;; copyright notice and this permission noti... | null | https://raw.githubusercontent.com/didierverna/tfm/30ef2114392063043d34f900a641a8510069db68/setup/src/readtable.lisp | lisp | Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SH... | readtable.lisp --- TFM readtable management
Copyright ( C ) 2019 , 2021
Author : < >
This file is part of TFM .
THIS SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF ... |
62398a454ad5e71c1bb796f362a6232a847da88b499884dffb21e55318a28124 | WorksHub/client | views.cljs | (ns wh.admin.activities.views
(:require [reagent.core :as r]
[wh.admin.activities.events]
[wh.admin.activities.subs :as subs]
[wh.re-frame.subs :refer [<sub]]
[wh.styles.stream-preview :as styles]
[wh.util :as util]))
(defn verb-style
[verb]
(case verb
... | null | https://raw.githubusercontent.com/WorksHub/client/a51729585c2b9d7692e57b3edcd5217c228cf47c/client/src/wh/admin/activities/views.cljs | clojure | (ns wh.admin.activities.views
(:require [reagent.core :as r]
[wh.admin.activities.events]
[wh.admin.activities.subs :as subs]
[wh.re-frame.subs :refer [<sub]]
[wh.styles.stream-preview :as styles]
[wh.util :as util]))
(defn verb-style
[verb]
(case verb
... | |
5724cccdf801b122ba78e56f5999417f76d00e3d42447170acba183df735c338 | spwhitton/consfigurator | timezone.lisp | ;;; Consfigurator -- Lisp declarative configuration management system
Copyright ( C ) 2021 < >
;;; This file 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 , or ( at your option )
;... | null | https://raw.githubusercontent.com/spwhitton/consfigurator/220548126a4c93a7205f78cabdda66ca77bae7dd/src/property/timezone.lisp | lisp | Consfigurator -- Lisp declarative configuration management system
This file is free software; you can redistribute it and/or modify
either version 3 , or ( at your option )
any later version.
This file is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty o... |
Copyright ( C ) 2021 < >
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
(in-package :consfigurator.property.timezone)
(named-readtables:in-readtable :consfigurator)
(defproplist configured :posix (timezone)
"Set t... |
0d3cabe4112288e3821ac85da5a7b5a1c9eaa75da72e0aa56e6fe34a7eee6b10 | clj-commons/ring-buffer | project.clj | (defproject amalloy/ring-buffer "1.3.2-SNAPSHOT"
:description "Persistent bounded-size queue implementation in Clojure"
:url "-commons/ring-buffer"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.10.1" :scope "provided"]
[org.clojure... | null | https://raw.githubusercontent.com/clj-commons/ring-buffer/32e283864361e6088fa283c98da0b2f9e55f8af7/project.clj | clojure | (defproject amalloy/ring-buffer "1.3.2-SNAPSHOT"
:description "Persistent bounded-size queue implementation in Clojure"
:url "-commons/ring-buffer"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.10.1" :scope "provided"]
[org.clojure... | |
e47a79e58c8bdce4fa1b061d13cd7460e6ffc46c877fe643015d41ad2b73e330 | TristeFigure/shuriken | string.clj | (ns shuriken.string
"### Functions on strings"
(:require [clojure.string :as str]
[clojure.pprint :refer [pprint] :as pprint]
[shuriken.sequential :refer [slice]]))
(defn format-code
"Returns a string as formatted by `clojure.pprint/code-dispatch`."
[code]
(str/trim
(with-out-str
... | null | https://raw.githubusercontent.com/TristeFigure/shuriken/cd36dd2a4005c85260125d89d5a3f475d248e6e4/src/shuriken/string.clj | clojure | (ns shuriken.string
"### Functions on strings"
(:require [clojure.string :as str]
[clojure.pprint :refer [pprint] :as pprint]
[shuriken.sequential :refer [slice]]))
(defn format-code
"Returns a string as formatted by `clojure.pprint/code-dispatch`."
[code]
(str/trim
(with-out-str
... | |
c5fefde0aba88295b5cc9d391b69dbc0388a5f0001e8b7dc93486fb42e0b5c16 | carlosavieira/self-study | 13.hs | data Count a = Multiple Integer a | Single a deriving (Show, Eq)
encodeDirect :: (Eq a) => [a] -> [Count a]
encodeDirect = encodeModified
add' :: Count a -> Count a
add' (Single x) = (Multiple 2 x)
add' (Multiple x y) = (Multiple (x+1) y)
elem' :: (Eq a) => a -> Count a -> Bool
elem' x (Multiple _ y) = (x==y)
elem' ... | null | https://raw.githubusercontent.com/carlosavieira/self-study/c7f998875f34a9d3623ade6deb75980affad2047/programming/Haskell/99%20problems/solutions/13.hs | haskell | data Count a = Multiple Integer a | Single a deriving (Show, Eq)
encodeDirect :: (Eq a) => [a] -> [Count a]
encodeDirect = encodeModified
add' :: Count a -> Count a
add' (Single x) = (Multiple 2 x)
add' (Multiple x y) = (Multiple (x+1) y)
elem' :: (Eq a) => a -> Count a -> Bool
elem' x (Multiple _ y) = (x==y)
elem' ... | |
6fac70f497b65ed79d734759d818aef62308c3a331159dc80bacf6245572d4e3 | GaloisInc/HaNS | Types.hs | # LANGUAGE DeriveGeneric #
{-# LANGUAGE DeriveDataTypeable #-}
module Hans.Addr.Types where
import Hans.IP4.Packet (IP4,putIP4,showIP4)
import Data.Hashable (Hashable)
import Data.Serialize (Put)
import Data.Typeable (Typeable)
import GHC.Generics (Generic)
data Addr = Addr4 !IP4
deriving (Eq,Ord,Show,Ge... | null | https://raw.githubusercontent.com/GaloisInc/HaNS/2af19397dbb4f828192f896b223ed2b77dd9a055/src/Hans/Addr/Types.hs | haskell | # LANGUAGE DeriveDataTypeable # | # LANGUAGE DeriveGeneric #
module Hans.Addr.Types where
import Hans.IP4.Packet (IP4,putIP4,showIP4)
import Data.Hashable (Hashable)
import Data.Serialize (Put)
import Data.Typeable (Typeable)
import GHC.Generics (Generic)
data Addr = Addr4 !IP4
deriving (Eq,Ord,Show,Generic,Typeable)
instance Hashable A... |
08d0548748a94402af092fb5705a5c2e2d6adc709081e474d825e10a91162055 | Clojure2D/clojure2d | color.clj | ^{:nextjournal.clerk/visibility :hide-ns
:nextjournal.clerk/toc true}
(ns notebooks.color
(:require
[clerk.styles :refer [color-styles 🎨]]
[clojure2d.color :as c]
[clojure2d.color.blend :as bl]
[clojure2d.color.cssgram :as cssgram]
[clojure2d.core :as c2d]
[clojure2d.extra.utils :as utils]
[cl... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d/c34b435ef86941c8121dc4802e0ccbc0a6ce949f/notebooks/color.clj | clojure |
* various color representations
* color spaces coversions
* palettes and gradients
* distances
* blending
# Intro
* `palette` - vector of colors
# Color
The full list of names can be found [here]() or retrieved by calling:
Colors from this resource are prefixed by a `:docc/` namespace.
To convert any col... | ^{:nextjournal.clerk/visibility :hide-ns
:nextjournal.clerk/toc true}
(ns notebooks.color
(:require
[clerk.styles :refer [color-styles 🎨]]
[clojure2d.color :as c]
[clojure2d.color.blend :as bl]
[clojure2d.color.cssgram :as cssgram]
[clojure2d.core :as c2d]
[clojure2d.extra.utils :as utils]
[cl... |
068b3db103c5d029225a07e3d443f672ffb32230ef1c93778fc223c72653139d | witheve/eve-experiments | util.clj | (ns server.util)
(defn partition-2 [pred coll]
((juxt
(partial filter pred)
(partial filter (complement pred)))
coll))
(defn merge-state [a b]
(if (map? a)
(merge-with merge-state a b)
(if (coll? a)
(into a b)
b)))
| null | https://raw.githubusercontent.com/witheve/eve-experiments/8a1cdb353b3e728bc768b315e5b9a9f9dc785ae1/server/src/server/util.clj | clojure | (ns server.util)
(defn partition-2 [pred coll]
((juxt
(partial filter pred)
(partial filter (complement pred)))
coll))
(defn merge-state [a b]
(if (map? a)
(merge-with merge-state a b)
(if (coll? a)
(into a b)
b)))
| |
6c98be8b28029b41cbeec9946c8b0a58e789967126edafd402246e1ff4a673e5 | jimweirich/sicp-study | ex2_04.scm | SICP 2.4
Exercise 2.4 . Here is an alternative procedural representation of
;; pairs. For this representation, verify that (car (cons x y)) yields
;; x for any objects x and y.
;; (define (cons x y)
;; (lambda (m) (m x y)))
;; (define (car z)
;; (z (lambda (p q) p)))
;; What is the corresponding definitio... | null | https://raw.githubusercontent.com/jimweirich/sicp-study/bc5190e04ed6ae321107ed6149241f26efc1b8c8/scheme/chapter2/ex2_04.scm | scheme | pairs. For this representation, verify that (car (cons x y)) yields
x for any objects x and y.
(define (cons x y)
(lambda (m) (m x y)))
(define (car z)
(z (lambda (p q) p)))
What is the corresponding definition of cdr? (Hint: To verify that
this works, make use of the substitution model of section 1.1.5.)
... | SICP 2.4
Exercise 2.4 . Here is an alternative procedural representation of
(define (cons x y)
(lambda (m) (m x y)))
(define (car z)
(z (lambda (p q) p)))
(define (cdr z)
(z (lambda (p q) q)))
(car (cons x y))
(car (lambda (m) (m x y)))
((lambda (m) (m x y)) (lambda (p q) p))
((lambda (p q) p) x y... |
3c021e4cc0294fd43afa2718e266465bd95b5fb50fd164c7eb1bad73605112f9 | sicmutils/sicmutils | noether_test.cljc | #_"SPDX-License-Identifier: GPL-3.0"
(ns sicmutils.mechanics.noether-test
(:require [clojure.test :refer [is deftest]]
[sicmutils.abstract.function :as f]
[sicmutils.generic :as g]
[sicmutils.mechanics.lagrange :as l]
[sicmutils.mechanics.noether :as n]
[si... | null | https://raw.githubusercontent.com/sicmutils/sicmutils/f427fd073937faf62741fcdda6362f910ecda71f/test/sicmutils/mechanics/noether_test.cljc | clojure | #_"SPDX-License-Identifier: GPL-3.0"
(ns sicmutils.mechanics.noether-test
(:require [clojure.test :refer [is deftest]]
[sicmutils.abstract.function :as f]
[sicmutils.generic :as g]
[sicmutils.mechanics.lagrange :as l]
[sicmutils.mechanics.noether :as n]
[si... | |
48f21bcd2e205e4bbef8c094875e80246793c65427d1d418fd7e17b85925a52b | deadpendency/deadpendency | ComponentDetailsLoader.hs | module SR.Loader.ComponentDetailsLoader
( loadComponentDetails,
)
where
import Common.Model.Details.Component
import Common.Model.Details.ComponentDetails
loadComponentDetails :: ComponentDetails
loadComponentDetails =
ComponentDetails
{ _component = ScriptRunner,
_componentTextName = "script-runner"
... | null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/script-runner/src/SR/Loader/ComponentDetailsLoader.hs | haskell | module SR.Loader.ComponentDetailsLoader
( loadComponentDetails,
)
where
import Common.Model.Details.Component
import Common.Model.Details.ComponentDetails
loadComponentDetails :: ComponentDetails
loadComponentDetails =
ComponentDetails
{ _component = ScriptRunner,
_componentTextName = "script-runner"
... | |
bd4ad14f111885ac92da6e95249adf3567cee325a67ab0ce956273b0825dde85 | reasonml/reason | ast_402.ml | (**************************************************************************)
(* *)
(* OCaml Migrate Parsetree *)
(* *)
... | null | https://raw.githubusercontent.com/reasonml/reason/4f6ff7616bfa699059d642a3d16d8905d83555f6/src/vendored-omp/src/ast_402.ml | ocaml | ************************************************************************
OCaml Migrate Parsetree
... |
and , Europe
, projet Cristal , INRIA Rocquencourt
, LexiFi
, projet Cristal , INRIA Rocquencourt
Copyright 2017 Institut... |
9e4ba3c8a19e0f7f23909970ab68dd96ec9a472ecd0745ab7be46925662a418b | qitab/ace.core | switch.lisp | Copyright 2020 Google LLC
;;;
Use of this source code is governed by an MIT - style
;;; license that can be found in the LICENSE file or at
;;; .
;;;;
A simple switch macro , sans the problems of other implementations .
;;;;
(defpackage #:ace.core.switch
(:use #:cl #:ace.core #:ace.core.macro)
(:export #:sw... | null | https://raw.githubusercontent.com/qitab/ace.core/e6eb21ff67b0c5eaec21c9b543b6dce18d7c8e6d/switch.lisp | lisp |
license that can be found in the LICENSE file or at
.
| Copyright 2020 Google LLC
Use of this source code is governed by an MIT - style
A simple switch macro , sans the problems of other implementations .
(defpackage #:ace.core.switch
(:use #:cl #:ace.core #:ace.core.macro)
(:export #:switch #:eswitch #:switch*))
(in-package #:ace.core.switch)
(defun! parse-sw... |
3264df719f620858aa1c34069fb725e8c7cb131642b4b35bb22f09919a7c4b53 | racket/racklog | laps.rkt | #lang racklog
% Laps Test
contains(ca, store, rams_couch, rams).
contains(rams, fetch, rams_couch, will).
contains(ca, fetch, Name, Watcher) :-
contains(ca, store, Name, Owner),
contains(Owner, fetch, Name, Watcher).
trusted(ca).
permit(User, Priv, Name) :-
contains(Auth, Priv, Name, User),
trusted(Auth... | null | https://raw.githubusercontent.com/racket/racklog/89e983ec7d2df0ed919e6630403b0f4d0393728e/tests/lang/laps.rkt | racket | #lang racklog
% Laps Test
contains(ca, store, rams_couch, rams).
contains(rams, fetch, rams_couch, will).
contains(ca, fetch, Name, Watcher) :-
contains(ca, store, Name, Owner),
contains(Owner, fetch, Name, Watcher).
trusted(ca).
permit(User, Priv, Name) :-
contains(Auth, Priv, Name, User),
trusted(Auth... | |
abbf85e7e7603b3219739d4bd5cd8fc7adf891fe883148ba2054b483dbccc784 | rbkmoney/fistful-server | ff_withdrawal_status_codec.erl | -module(ff_withdrawal_status_codec).
-behaviour(ff_codec).
-include_lib("fistful_proto/include/ff_proto_withdrawal_status_thrift.hrl").
-export([marshal/2]).
-export([unmarshal/2]).
%% API
-spec marshal(ff_codec:type_name(), ff_codec:decoded_value()) -> ff_codec:encoded_value().
marshal(status, pending) ->
{pe... | null | https://raw.githubusercontent.com/rbkmoney/fistful-server/60b964d0e07f911c841903bc61d8d9fb20a32658/apps/ff_server/src/ff_withdrawal_status_codec.erl | erlang | API
TESTS | -module(ff_withdrawal_status_codec).
-behaviour(ff_codec).
-include_lib("fistful_proto/include/ff_proto_withdrawal_status_thrift.hrl").
-export([marshal/2]).
-export([unmarshal/2]).
-spec marshal(ff_codec:type_name(), ff_codec:decoded_value()) -> ff_codec:encoded_value().
marshal(status, pending) ->
{pending, ... |
a213e057ba72b6a0196e6e2ddad13f2824cfec00d7bdbaa897af700252d35aab | formal-land/coq-of-ocaml | attribute.ml | open Monad.Notations
* The OCaml attributes to customize the Coq generation .
type t =
| AxiomWithReason
| Cast
| ForceGadt
| GrabExistentials
| TaggedGadt
| Implicit of string * string
| MatchGadt
| MatchGadtWithResult
| MatchWithDefault
| MutualAsNotation
| Phantom
| PlainModule
| Struct of... | null | https://raw.githubusercontent.com/formal-land/coq-of-ocaml/19fe7cf51722da9453cb7ce43724e774e7c9d040/src/attribute.ml | ocaml | * We compute the existence of this attribute outside of the monad for
performance reasons. | open Monad.Notations
* The OCaml attributes to customize the Coq generation .
type t =
| AxiomWithReason
| Cast
| ForceGadt
| GrabExistentials
| TaggedGadt
| Implicit of string * string
| MatchGadt
| MatchGadtWithResult
| MatchWithDefault
| MutualAsNotation
| Phantom
| PlainModule
| Struct of... |
36fb3a0e81e0da449661a3b48a2463f87ca60bb52e825773e415b3ecae78b2ae | ocsigen/js_of_ocaml | tformat.ml | (* TEST
include testing
*)
(*
A test file for the Format module.
*)
open Testing;;
open Format;;
let say s = Printf.printf s;;
try
say "d/i positive\n%!";
test (sprintf "%d/%i" 42 43 = "42/43");
test (sprintf "%-4d/%-5i" 42 43 = "42 /43 ");
test (sprintf "%04d/%05i" 42 43 = "0042/00043");
test (s... | null | https://raw.githubusercontent.com/ocsigen/js_of_ocaml/31c8a3d9d4e34f3fd573dd5056e733233ca4f4f6/compiler/tests-ocaml/lib-format/tformat.ml | ocaml | TEST
include testing
A test file for the Format module.
test (sprintf "%07S" "foo" = " \"foo\"");
%S is incompatible with '0'
%S is incompatible with '0','+' and ' '
test (sprintf "%-4c" 'c' = "c "); padding not done
test (sprintf "%4c" 'c' = " c"); padding not done
test (sprintf "%*... |
open Testing;;
open Format;;
let say s = Printf.printf s;;
try
say "d/i positive\n%!";
test (sprintf "%d/%i" 42 43 = "42/43");
test (sprintf "%-4d/%-5i" 42 43 = "42 /43 ");
test (sprintf "%04d/%05i" 42 43 = "0042/00043");
test (sprintf "%+d/%+i" 42 43 = "+42/+43");
test (sprintf "% d/% i" 42 43 = " ... |
f233433e104cb87b13a8cebf013ec4e3fc3ad6fc0809aafa4848d11fde5fa74f | oakes/Paravim | constants.cljc | (ns paravim.constants
(:require [play-cljc.gl.entities-2d :as e]))
(def orig-camera (e/->camera))
(def buttons [{:id ::font-inc
:text "Font +"
:shortcut-char 5}
{:id ::font-dec
:text "Font -"
:shortcut-char 5}
{:id ::reload-file... | null | https://raw.githubusercontent.com/oakes/Paravim/871b9adf4e9819a7b9f2c63466c55640f0f8c280/src/paravim/constants.cljc | clojure | (ns paravim.constants
(:require [play-cljc.gl.entities-2d :as e]))
(def orig-camera (e/->camera))
(def buttons [{:id ::font-inc
:text "Font +"
:shortcut-char 5}
{:id ::font-dec
:text "Font -"
:shortcut-char 5}
{:id ::reload-file... | |
0cf5a08f66e8a263d4ebfea25dbf8069bfdf811b7e152a711f37878d0b456daa | SamB/coq | tacexpr.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/SamB/coq/8f84aba9ae83a4dc43ea6e804227ae8cae8086b1/proofs/tacexpr.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
i $Id$ i
true = Left-to-right fa... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Names
open Topconstr
... |
1e64b252344ece563ff5b1dbe0b2bd5e3fe45048ec534728d56c4b226c524689 | fpottier/mpri-2.4-projet-2022-2023 | SurfaceGenerator.ml | let length, map, filter_map, zip = List.(length, map, filter_map, combine)
open Surface
(* -------------------------------------------------------------------------- *)
(* Fresh names. *)
let fresh, clear =
Gensym.make()
let fresh _ : var =
Printf.sprintf "x%d" (fresh())
let ffresh, fclear =
Gensym.make()
l... | null | https://raw.githubusercontent.com/fpottier/mpri-2.4-projet-2022-2023/1ce08cadfb3a8ec8bc72609bc82873b29d2ce241/src/SurfaceGenerator.ml | ocaml | --------------------------------------------------------------------------
Fresh names.
--------------------------------------------------------------------------
--------------------------------------------------------------------------
Random choices.
[choose xs] chooses a random element in the list [xs].
... | let length, map, filter_map, zip = List.(length, map, filter_map, combine)
open Surface
let fresh, clear =
Gensym.make()
let fresh _ : var =
Printf.sprintf "x%d" (fresh())
let ffresh, fclear =
Gensym.make()
let ffresh _ : name =
Printf.sprintf "f%d" (ffresh())
Budget splitting .
let split_max bound b... |
f60dc12bc782caeeaca5b084cf85a7fd4cec7c787768fcac6740fa0fa3ca544b | fulcrologic/fulcro-rad-kvstore | timezone.cljc | (ns com.example.model.timezone
(:require
[clojure.spec.alpha :as s]
[clojure.string :as str]
[taoensso.timbre :as log]
[com.wsscode.pathom.connect :as pc]
[com.fulcrologic.rad.form-options :as fo]
[com.fulcrologic.rad.attributes :refer [defattr]]
[com.fulcrologic.rad.attributes-options :as... | null | https://raw.githubusercontent.com/fulcrologic/fulcro-rad-kvstore/4d1860c4250a6d8acc39a38ba87e1abfd6175afa/src/demo-project/com/example/model/timezone.cljc | clojure | Enumerations with lots of values should use autocomplete instead of pushing all possible values to UI | (ns com.example.model.timezone
(:require
[clojure.spec.alpha :as s]
[clojure.string :as str]
[taoensso.timbre :as log]
[com.wsscode.pathom.connect :as pc]
[com.fulcrologic.rad.form-options :as fo]
[com.fulcrologic.rad.attributes :refer [defattr]]
[com.fulcrologic.rad.attributes-options :as... |
3564b5c996bfc9870f2579b8af1cea4b82072234d05fc9d199d05249d3158d67 | koka-lang/koka | Trace.hs | ------------------------------------------------------------------------------
Copyright 2012 - 2021 , Microsoft Research , .
--
-- This is free software; you can redistribute it and/or modify it under the
terms of the Apache License , Version 2.0 . A copy of the License can be
-- found in the LICENSE file at the... | null | https://raw.githubusercontent.com/koka-lang/koka/50cd25fdfb0f917c2908ac12df14dd628547e0ad/src/Lib/Trace.hs | haskell | ----------------------------------------------------------------------------
This is free software; you can redistribute it and/or modify it under the
found in the LICENSE file at the root of this distribution.
---------------------------------------------------------------------------
Debug module to insert 't... | Copyright 2012 - 2021 , Microsoft Research , .
terms of the Apache License , Version 2.0 . A copy of the License can be
module Lib.Trace( trace, traceDoc, ctrace, Color(..), traceShowId, traceShow, traceM, traceShowM, traceId, traceEq ) where
import Lib.Printer
import Lib.PPrint
import Platform.Runtime( unsafePe... |
aacc8999c5634c3c119b222992027a76b74968bd232c1d523db1cc47db17592d | nomeata/free-theorems-static-webui | LanguageSubsets.hs | {-# LANGUAGE DeriveDataTypeable #-}
| Declares the available language subsets and the result types for
-- generating free theorems.
module Language.Haskell.FreeTheorems.LanguageSubsets where
import Data.Generics (Typeable, Data)
| Descriptions of the language subsets for which free theorems can
-- be... | null | https://raw.githubusercontent.com/nomeata/free-theorems-static-webui/44149706c2b809734ab3848047e314359bc59ccb/free-theorems/src/Language/Haskell/FreeTheorems/LanguageSubsets.hs | haskell | # LANGUAGE DeriveDataTypeable #
generating free theorems.
be generated.
^ This subset describes only terms in which no undefinedness may.
This excludes terms defined using general recursion or selective
strictness (as offered by @seq@).
^ This subset describes terms in which undefined values may occur
... |
| Declares the available language subsets and the result types for
module Language.Haskell.FreeTheorems.LanguageSubsets where
import Data.Generics (Typeable, Data)
| Descriptions of the language subsets for which free theorems can
data LanguageSubset
= BasicSubset
| SubsetWithFix TheoremType
| Su... |
90e009e8b59bbba391e018026af25142133e9a04ebc8146d7ca7b32d3a6206af | jankronquist/rock-paper-scissors-in-clojure | domain.clj | (ns com.jayway.rps.datomic.domain
(:require [datomic.api :as datomic]
[com.jayway.rps.datomic.framework :as f]))
(defrecord SetPlayerNameCommand [aggregate-id name])
(defmulti compare-moves vector)
(defmethod compare-moves [:rock :rock] [x y] :tie)
(defmethod compare-moves [:rock :paper] [x y] :loss)
(d... | null | https://raw.githubusercontent.com/jankronquist/rock-paper-scissors-in-clojure/9abecaa4d1a305e3ee268eed9a010c24b36c152d/datomic/src/com/jayway/rps/datomic/domain.clj | clojure | (ns com.jayway.rps.datomic.domain
(:require [datomic.api :as datomic]
[com.jayway.rps.datomic.framework :as f]))
(defrecord SetPlayerNameCommand [aggregate-id name])
(defmulti compare-moves vector)
(defmethod compare-moves [:rock :rock] [x y] :tie)
(defmethod compare-moves [:rock :paper] [x y] :loss)
(d... | |
97307a252f1c1d876aae61f4bdfc304a94fdda4a6eb00b793bd3fc49fffaaa9a | jumarko/clojure-experiments | pagination.clj | ;; # Pagination
(ns notebooks.pagination
(:require [babashka.fs :as fs]))
#_(nextjournal.clerk/show! "notebooks/pagination.clj")
(range)
(def notebooks
(clojure.java.io/file "notebooks"))
(def words-path "/usr/share/dict/words")
(when-let [words (and (fs/exists? words-path) (slurp words-path))]
(subs words 0... | null | https://raw.githubusercontent.com/jumarko/clojure-experiments/a87098fe69044ad65813a68cb870d824c2c2d18f/src/clojure_experiments/visualizations/clerk/notebooks/pagination.clj | clojure | # Pagination
A long list.
A somewhat large map. | (ns notebooks.pagination
(:require [babashka.fs :as fs]))
#_(nextjournal.clerk/show! "notebooks/pagination.clj")
(range)
(def notebooks
(clojure.java.io/file "notebooks"))
(def words-path "/usr/share/dict/words")
(when-let [words (and (fs/exists? words-path) (slurp words-path))]
(subs words 0 10100))
[noteb... |
5ceef6ccb75d54566f5d3683c65ccd5c84978c396e66590944cea3eb17c5e929 | danhper/evm-analyzer | tracer.mli | open Core
type t
val create: block_number:Int.t -> tx_hash:String.t ->
taggers:TracerTypes.Tagger.t List.t List.t -> String.t -> t
val execute_traces: ?debug:bool -> ?timeout:float -> ?db:FactDb.t -> t -> Trace.t List.t -> (FactDb.t * bool)
| null | https://raw.githubusercontent.com/danhper/evm-analyzer/9fb1cf6dc743c2f779973b2f0892047ebbd4e5fd/src/tracer.mli | ocaml | open Core
type t
val create: block_number:Int.t -> tx_hash:String.t ->
taggers:TracerTypes.Tagger.t List.t List.t -> String.t -> t
val execute_traces: ?debug:bool -> ?timeout:float -> ?db:FactDb.t -> t -> Trace.t List.t -> (FactDb.t * bool)
| |
ae72c669b3286d640b7573f50e21e81ff2de53e4d7cf2a3b1299d58fb3ba1398 | bozsahin/ccglab | init-alisp.lisp | (format t "~%init-alisp.lisp loaded")
| null | https://raw.githubusercontent.com/bozsahin/ccglab/15def13c76e562a053ff92d61353549818d2a7e3/bin/init-alisp.lisp | lisp | (format t "~%init-alisp.lisp loaded")
| |
d984aec58c66823496e79b17b6c12df433ad0f94906e557f07381c76f760a6ff | chris-taylor/aima-haskell | likelihoodWeighting.hs | import AI.Probability.Example.Alarm
import AI.Util.ProbDist
n :: Int
n = 100000
fixed :: [(String,Bool)]
fixed = [("JohnCalls",True),("MaryCalls",True)]
x :: String
x = "Burglary"
main :: IO ()
main = do
putStrLn "----------"
let d1 = enumerationAsk alarm fixed x
putInfo d1
d2 <- likelihoodWeighti... | null | https://raw.githubusercontent.com/chris-taylor/aima-haskell/538dcfe82a57a623e45174e911ce68974d8aa839/profiling/LikelihoodWeighting/likelihoodWeighting.hs | haskell | import AI.Probability.Example.Alarm
import AI.Util.ProbDist
n :: Int
n = 100000
fixed :: [(String,Bool)]
fixed = [("JohnCalls",True),("MaryCalls",True)]
x :: String
x = "Burglary"
main :: IO ()
main = do
putStrLn "----------"
let d1 = enumerationAsk alarm fixed x
putInfo d1
d2 <- likelihoodWeighti... | |
ae5c6443b597134818d82be49c5dd3fb77d0b4171e05e426a14d29dbdc44f929 | aturon/Caper | treiber.rkt | #lang racket/base
(require caper/data/treiber
caper/tests/test-tools
rackunit)
(define s (make-treiber-stack))
(check-equal? (pop! s #f) #f "pop! on empty stack not failure-result")
(push! s 1)
(check-equal? (pop! s) 1 "pop! on singleton stack not singleton")
(check-equal? (pop! s #f) #f "pop! on empty s... | null | https://raw.githubusercontent.com/aturon/Caper/be05f13f3189c7717cd14a223b0cb3b188fe5bb1/tests/data/treiber.rkt | racket | #lang racket/base
(require caper/data/treiber
caper/tests/test-tools
rackunit)
(define s (make-treiber-stack))
(check-equal? (pop! s #f) #f "pop! on empty stack not failure-result")
(push! s 1)
(check-equal? (pop! s) 1 "pop! on singleton stack not singleton")
(check-equal? (pop! s #f) #f "pop! on empty s... | |
bd5f6687809a531f9cdb4edc6f4f388073852c642b0f456564ef688697cf971d | jeapostrophe/exp | spec-encode.rkt | #lang racket/base
(require (for-syntax racket/base
syntax/parse
racket/syntax
racket/list)
racket/list
racket/match)
;; encode : value -> bytes
;; decode : bytes -> value
;; --->
;; encode : (v:value) ->
;; (vbs:bytes) (list (pair... | null | https://raw.githubusercontent.com/jeapostrophe/exp/43615110fd0439d2ef940c42629fcdc054c370f9/spec-encode.rkt | racket | encode : value -> bytes
decode : bytes -> value
--->
encode : (v:value) ->
(vbs:bytes) (list (pairs points-from encode-thunk))
decode : (heap:bytes) (start:addr) -> value
xxx if we knew total size, we'd make this mutating
Replace addr in nbs with addr (patch)
e.tree contains 0 everywhere but sh... | #lang racket/base
(require (for-syntax racket/base
syntax/parse
racket/syntax
racket/list)
racket/list
racket/match)
(struct addr*thunk (addr thunk))
(struct branch (left right))
(define (stitch vbs addr*et-tree)
(match addr*et-tree... |
af6a285c9924b9a248317915dfd50c0d0e24fb4fd22629ba616f06631edf19bd | danr/hipspec | PrettyRich.hs | {-# LANGUAGE OverloadedStrings #-}
-- | Pretty-printing the rich language, parameterised on whether to print
-- types of variables.
module HipSpec.Lang.PrettyRich where
import Text.PrettyPrint
import HipSpec.Lang.Rich
import HipSpec.Lang.PrettyUtils
import HipSpec.Lang.Type
ppProg :: Types -> P a -> Program a -> D... | null | https://raw.githubusercontent.com/danr/hipspec/a114db84abd5fee8ce0b026abc5380da11147aa9/src/HipSpec/Lang/PrettyRich.hs | haskell | # LANGUAGE OverloadedStrings #
| Pretty-printing the rich language, parameterised on whether to print
types of variables. | module HipSpec.Lang.PrettyRich where
import Text.PrettyPrint
import HipSpec.Lang.Rich
import HipSpec.Lang.PrettyUtils
import HipSpec.Lang.Type
ppProg :: Types -> P a -> Program a -> Doc
ppProg t p (Program _ds fs) = vcat (map (ppFun t p) fs)
ppFun :: Types -> P a -> Function a -> Doc
ppFun t p (Function f ty e) = p... |
353b84f83bd5542a51a619608cb01dd9e248772a30d3d22997a440c7115cef31 | Ella-Hoeppner/Vlojure | settings.cljs | (ns vlojure.pages.settings
(:require [vlojure.graphics :refer [app-rect
draw-circle
draw-line
draw-polyline
draw-polygon
draw-re... | null | https://raw.githubusercontent.com/Ella-Hoeppner/Vlojure/75925017485c31cab7dd9d65f5109f20b5616a2d/src/cljs/vlojure/pages/settings.cljs | clojure | This file contains the logic for the "settings" page. This page lets the
user create and delete projects as well as renaming and switching between
them, adjust the color scheme and different aspects of the app's visual
appearance, and add or remove formbars for the current project.
Sliders
Render formbar tools pa... | (ns vlojure.pages.settings
(:require [vlojure.graphics :refer [app-rect
draw-circle
draw-line
draw-polyline
draw-polygon
draw-re... |
c9a1165b8f7f50ff2958d6fb705e5203418cbbb912d18622d0a0acc6434c69b7 | clojure/java.jdbc | jdbc_test.clj | Copyright ( c ) , . All rights reserved .
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 ... | null | https://raw.githubusercontent.com/clojure/java.jdbc/acffd9f5f216f8b8c1fc960c1d47b0b5feb56730/src/test/clojure/clojure/java/jdbc_test.clj | clojure | 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 this notice, or any other,
from this software.
test_jdbc.clj
so these tests ex... | Copyright ( c ) , . All rights reserved .
The use and distribution terms for this software are covered by the Eclipse
This namespace contains tests that exercise the JDBC portion of java.jdbc
be tested without external infrastructure ( Apache Derby , HSQLDB ) . Other
scgilardi ( gmail )
Created 1... |
75982934c3463f1254a613bff3bce68ec7b4cddac58e082998fc3ce086fe22c4 | elginer/Delve | Core.hs |
The Delve Programming Language
Copyright 2009
Distributed under the terms of the GNU General Public License v3 , or ( at your option ) any later version .
This file is part of Delve .
Delve is free software : you can redistribute it and/or modify
it under the terms of the GNU Ge... | null | https://raw.githubusercontent.com/elginer/Delve/997c25d2c43ac3ab06f7d70304a59f4a8d5f9670/src/Core.hs | haskell | # OPTIONS -XTypeSynonymInstances #
This module is getting a little big
A non-polymorpic, stripped down version of the delve language.
All function applications are saturated
a sexy parser
reserved words
is the symbol legal?
gather not a reserved word
I need very specific behaviour from this function, so the gen... |
The Delve Programming Language
Copyright 2009
Distributed under the terms of the GNU General Public License v3 , or ( at your option ) any later version .
This file is part of Delve .
Delve is free software : you can redistribute it and/or modify
it under the terms of the GNU Ge... |
82f92c143210dce196f7f86fd93af08b123084554503c5f3c63ab52383d94db7 | lava-jato-the-game/lava-jato-the-game | integration_test.clj | (ns lava-jato-the-game.integration-test
(:require [clojure.test :refer [deftest]]
[midje.sweet :refer [fact => just]]
[lava-jato-the-game.test :as test]))
(deftest index-explorer
(let [session (test/->session)]
(fact
"Check if the index-explorer query returns any data."
(tes... | null | https://raw.githubusercontent.com/lava-jato-the-game/lava-jato-the-game/05c324ecc6ef4eab20042ee478f3ff2da957d0d0/src/test/lava_jato_the_game/integration_test.clj | clojure | (ns lava-jato-the-game.integration-test
(:require [clojure.test :refer [deftest]]
[midje.sweet :refer [fact => just]]
[lava-jato-the-game.test :as test]))
(deftest index-explorer
(let [session (test/->session)]
(fact
"Check if the index-explorer query returns any data."
(tes... | |
b1eadefa4f90f5b0f8fcded53aa9471bac239eb44071cc4780a6f653182667fb | darkling/lagra | lagra_bnode.erl | @private
-module(lagra_bnode).
-behaviour(gen_server).
%% API.
-export([start_link/0]).
-export([new/0]).
%% gen_server.
-export([init/1]).
-export([handle_call/3]).
-export([handle_cast/2]).
-export([handle_info/2]).
-export([terminate/2]).
-export([code_change/3]).
-record(state, {suffix :: binary(),
serial ... | null | https://raw.githubusercontent.com/darkling/lagra/6827ea20db86aeb4c139db45bd3133ffccfddb7d/src/lagra_bnode.erl | erlang | API.
gen_server.
API.
gen_server. | @private
-module(lagra_bnode).
-behaviour(gen_server).
-export([start_link/0]).
-export([new/0]).
-export([init/1]).
-export([handle_call/3]).
-export([handle_cast/2]).
-export([handle_info/2]).
-export([terminate/2]).
-export([code_change/3]).
-record(state, {suffix :: binary(),
serial :: integer()
}).
... |
629f028ada54b9771130562dc2822598368783703b358acf987cfcf1c16c2ecb | MaskRay/OJHaskell | order-exercises.hs | {-# LANGUAGE MultiWayIf, RecordWildCards #-}
import Control.Monad
import Data.Array.IArray
import Data.Functor
import Data.Maybe
import Data.Monoid
import qualified Data.ByteString.Char8 as B
ints = map (fst . fromJust . B.readInt) . B.words <$> B.getLine
-- = Pairing heap
data PairingHeap a = Empty | Node !a ![Pair... | null | https://raw.githubusercontent.com/MaskRay/OJHaskell/ba24050b2480619f10daa7d37fca558182ba006c/HackerRank/fp/order-exercises.hs | haskell | # LANGUAGE MultiWayIf, RecordWildCards #
= Pairing heap
= Subarray
# UNPACK #
= Segment tree
| Slice with max subarray
# UNPACK # | import Control.Monad
import Data.Array.IArray
import Data.Functor
import Data.Maybe
import Data.Monoid
import qualified Data.ByteString.Char8 as B
ints = map (fst . fromJust . B.readInt) . B.words <$> B.getLine
data PairingHeap a = Empty | Node !a ![PairingHeap a] ![PairingHeap a] deriving (Show)
merge l Empty = l
... |
7c278d272c62a517f0186c759ae13de754e2d276ae7f089707ae5e96633addbd | broom-lang/broom | MiddleEnd.mli | val to_cfg : debug: bool -> Fc.Program.t -> Cfg.Program.t
| null | https://raw.githubusercontent.com/broom-lang/broom/4666fddd9ab6bafc7ae93225fafdd2c18a498423/compiler/lib/MiddleEnd.mli | ocaml | val to_cfg : debug: bool -> Fc.Program.t -> Cfg.Program.t
| |
de17035a7aff38503ad2f7be3e285bee0c1a08c8751673e0ecc26bbfb1614c33 | CRogers/obc | table.mli |
* table.mli
*
* This file is part of the Oxford Oberon-2 compiler
* Copyright ( c ) 2006
* All rights reserved
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1 . Redistributions ... | null | https://raw.githubusercontent.com/CRogers/obc/49064db244e0c9d2ec2a83420c8d0ee917b54196/yacc/table.mli | ocaml | row -- type of parse table rows
empty_row -- the empty row
pack_rows -- pack all rows into the table
After pack_rows ...
start -- fetch base of row after packing
table, check -- the checked table itself |
* table.mli
*
* This file is part of the Oxford Oberon-2 compiler
* Copyright ( c ) 2006
* All rights reserved
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1 . Redistributions ... |
c450edc55d2e11e7523e0adaccf17648ee89e718b530385b14d03fe6f141d908 | nasa/Common-Metadata-Repository | repl.clj | (ns cmr.exchange.query.repl
"CMR Exchange/Query development namespace."
(:require
[cheshire.core :as json]
[clojure.java.io :as io]
[clojure.pprint :refer [pprint]]
[clojure.set :as set]
[clojure.string :as string]
[clojure.tools.namespace.repl :as repl]
[clojusc.system-manager.core :as system-... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/63001cf021d32d61030b1dcadd8b253e4a221662/other/cmr-exchange/exchange-query/dev-resources/src/cmr/exchange/query/repl.clj | clojure |
Initial Setup & Utility Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
It is not always desired that a system be started up upon REPL loading.
Thus, we set the options and perform any global operations with init,
and let the user determine when then want to bring up (a potentially
computationally intensive) s... | (ns cmr.exchange.query.repl
"CMR Exchange/Query development namespace."
(:require
[cheshire.core :as json]
[clojure.java.io :as io]
[clojure.pprint :refer [pprint]]
[clojure.set :as set]
[clojure.string :as string]
[clojure.tools.namespace.repl :as repl]
[clojusc.system-manager.core :as system-... |
467ab1f93ec2ce81713d99e10e15db65007d064b1730b52d601ecfcaf2ade58e | tschady/advent-of-code | d05_test.clj | (ns aoc.2017.d05-test
(:require [aoc.2017.d05 :as sut]
[clojure.test :refer :all]))
(deftest part-1-examples
(are [output input] (= output (sut/part-1 input))
5 [0 3 0 1 -3]))
(deftest part-2-examples
(are [output input] (= output (sut/part-2 input))
10 [0 3 0 1 -3]))
(deftest challenge
(... | null | https://raw.githubusercontent.com/tschady/advent-of-code/1e4a95ef580c3bf635837eff52aa998b0acfc666/test/aoc/2017/d05_test.clj | clojure | (ns aoc.2017.d05-test
(:require [aoc.2017.d05 :as sut]
[clojure.test :refer :all]))
(deftest part-1-examples
(are [output input] (= output (sut/part-1 input))
5 [0 3 0 1 -3]))
(deftest part-2-examples
(are [output input] (= output (sut/part-2 input))
10 [0 3 0 1 -3]))
(deftest challenge
(... | |
e5dec2c17c1190895cacdaae3d6ef18089ccd43b806a6c8dcbb0de5c2e77897f | kovisoft/slimv | swank-buffer-streams.lisp | ;;; swank-buffer-streams.lisp --- Streams that output to a buffer
;;;
Authors : < >
;;;
;;; License: This code has been placed in the Public Domain. All warranties
;;; are disclaimed.
(in-package :swank)
(defpackage :swank-buffer-streams
(:use :cl)
(:import-from :swank
defslimefun... | null | https://raw.githubusercontent.com/kovisoft/slimv/cf8334cb7d71bf9793cb5588497b4fe15e501626/slime/contrib/swank-buffer-streams.lisp | lisp | swank-buffer-streams.lisp --- Streams that output to a buffer
License: This code has been placed in the Public Domain. All warranties
are disclaimed. | Authors : < >
(in-package :swank)
(defpackage :swank-buffer-streams
(:use :cl)
(:import-from :swank
defslimefun
add-hook
encode-message
send-event
find-thread
dcase
current-socket-io
... |
4bf5c6e6f2b6c77e6ab9dc31d4394973487d12507cad24a7ac3ce6278febb6a8 | shortishly/pgmp | pgmp.erl | Copyright ( c ) 2022 < >
%%
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 applicable law or agreed to in writing, software
distributed under... | null | https://raw.githubusercontent.com/shortishly/pgmp/9e35f259d481cf24f69937a595fc1d1e507528fc/src/pgmp.erl | erlang |
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 language governing permissi... | Copyright ( c ) 2022 < >
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(pgmp).
-export([get_env/1]).
-export([priv_consult/1]).
-export([priv_dir/0]).
-export([start/0]).
-export_type([bind_complete/0]).
-ex... |
910bde647e5177ea59f2e169ed1f20c29b469b8040e80ebb26c9ee612f999626 | GlideAngle/flare-timing | Coincident.hs | module Sphere.Coincident (coincidentUnits) where
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit as HU ((@?=), testCase)
import Data.UnitsOfMeasure (u, convert, fromRational')
import Data.UnitsOfMeasure.Internal (Quantity(..))
import Flight.Distance (TaskDistance(..), PathDistance(..))
import Flight.Z... | null | https://raw.githubusercontent.com/GlideAngle/flare-timing/27bd34c1943496987382091441a1c2516c169263/lang-haskell/earth/test-suite-zones/Sphere/Coincident.hs | haskell | module Sphere.Coincident (coincidentUnits) where
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit as HU ((@?=), testCase)
import Data.UnitsOfMeasure (u, convert, fromRational')
import Data.UnitsOfMeasure.Internal (Quantity(..))
import Flight.Distance (TaskDistance(..), PathDistance(..))
import Flight.Z... | |
8797683f78e0742f0b94fc74be8e7b7a8e1ffa718721a02888e50eac0b151f2f | lvh/caesium | byte_bufs.clj | (ns caesium.byte-bufs
"Byte buffer utilities, like conversions and length."
(:require [byte-streams :as bs])
(:import (java.nio ByteBuffer)))
(def bytes= bs/bytes=)
(defn ^ByteBuffer ->indirect-byte-buf
"Convert buffer to a [[ByteBuffer]].
If the input is not a byte buffer already, will be converted to an
... | null | https://raw.githubusercontent.com/lvh/caesium/cb90a4325fa48a2e4fb6cad810f340125a53fc57/src/caesium/byte_bufs.clj | clojure | (ns caesium.byte-bufs
"Byte buffer utilities, like conversions and length."
(:require [byte-streams :as bs])
(:import (java.nio ByteBuffer)))
(def bytes= bs/bytes=)
(defn ^ByteBuffer ->indirect-byte-buf
"Convert buffer to a [[ByteBuffer]].
If the input is not a byte buffer already, will be converted to an
... | |
458b341a827957d79bc21b8ae8a22c861b7f05e006c0708d2779f8bdddce2e45 | mokus0/junkbox | PeasantMultiplication.hs | module Math.PeasantMultiplication where
import Data.Maybe
import Text.PrettyPrint
import Text.Printf
mult :: Integer -> Integer -> ([(Integer, Integer, Maybe Integer)], Integer)
mult x y
| x > 0 && y > 0 = go x y [] [] []
| otherwise = error "mult: positive numbers required"
where
go 0 ... | null | https://raw.githubusercontent.com/mokus0/junkbox/151014bbef9db2b9205209df66c418d6d58b0d9e/Haskell/Math/PeasantMultiplication.hs | haskell | module Math.PeasantMultiplication where
import Data.Maybe
import Text.PrettyPrint
import Text.Printf
mult :: Integer -> Integer -> ([(Integer, Integer, Maybe Integer)], Integer)
mult x y
| x > 0 && y > 0 = go x y [] [] []
| otherwise = error "mult: positive numbers required"
where
go 0 ... | |
a384169f5cdb84249764dad7363417129db741e21f86872d124eb2d9865aea0e | processone/stun | turn.erl | %%%-------------------------------------------------------------------
%%% File : turn.erl
Author : < >
%%% Description : Handles TURN allocations, see RFC5766
Created : 23 Aug 2009 by < >
%%%
%%%
Copyright ( C ) 2002 - 2023 ProcessOne , SARL . All Rights Reserved .
%%%
Licensed under the Apache Lice... | null | https://raw.githubusercontent.com/processone/stun/5e41e347d97da0f68182a0870af806354996ab99/src/turn.erl | erlang | -------------------------------------------------------------------
File : turn.erl
Description : Handles TURN allocations, see RFC5766
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 writin... | Author : < >
Created : 23 Aug 2009 by < >
Copyright ( C ) 2002 - 2023 ProcessOne , SARL . 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(turn).
-define(GEN_FSM, p1_fsm).
-behavio... |
a9cdba2022108af1f7d3a8cd4df0bfd8c7e5f63d197ad48bc2d410f11f4b7d07 | Smoltbob/Caml-Est-Belle | let2.ml | let x= 1.5 +. 5 in
let y=2 + x in
()
| null | https://raw.githubusercontent.com/Smoltbob/Caml-Est-Belle/3d6f53d4e8e01bbae57a0a402b7c0f02f4ed767c/tests/typechecking/invalid/let2.ml | ocaml | let x= 1.5 +. 5 in
let y=2 + x in
()
| |
2fc9c853076a03d45c5c8010ff56a85be410fe640d05037da80701bfc93cdaee | peterholko/pax_server | item.erl | %% -------------------------------------------------------------------
Author :
%%% Description :
%%%
Created : June 23 , 2010
%%% -------------------------------------------------------------------
-module(item).
-behaviour(gen_server).
%% --------------------------------------------------------------------
%%... | null | https://raw.githubusercontent.com/peterholko/pax_server/62b2ec1fae195ff915d19af06e56a7c4567fd4b8/src/item.erl | erlang | -------------------------------------------------------------------
Description :
-------------------------------------------------------------------
--------------------------------------------------------------------
Include files
--------------------------------------------------------------------
----------... | Author :
Created : June 23 , 2010
-module(item).
-behaviour(gen_server).
-include("schema.hrl").
-include("common.hrl").
-export([start/0, init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-export([create/4, create_get_id/4, delete/1, set/2, transfer/3, get_by_type/3, get_by_ent... |
5bdb0b1507cb1a68bcf3fbb174304e18e117b1c46982b26d6ec9ee118fe1830c | walfie/ac-tune-maker | Tune.ml | module Index = struct
type t = int
let min = 0
let max = 15
let to_int i = i
let has_prev i = i > min
let has_next i = i < max
let prev i = if has_prev i then Some (i - 1) else None
let next i = if has_next i then Some (i + 1) else None
let prev_bounded i = if has_prev i then i - 1 else i
let next_... | null | https://raw.githubusercontent.com/walfie/ac-tune-maker/fe98aa88ae643630a572612367411b63da60df92/src/Tune.ml | ocaml | module Index = struct
type t = int
let min = 0
let max = 15
let to_int i = i
let has_prev i = i > min
let has_next i = i < max
let prev i = if has_prev i then Some (i - 1) else None
let next i = if has_next i then Some (i + 1) else None
let prev_bounded i = if has_prev i then i - 1 else i
let next_... | |
57a6da3fe4ccaa7593fbb78c8dba84eafd7cb8a095ff9539787523498b0083d7 | pkpkpk/fress | samples.cljs | (ns fress.samples
(:require-macros [fress.test-macros :as mac])
(:require [cljs.tools.reader :refer [read-string]]
[fress.util :as util]))
(def int-samples
[{:form "Short/MIN_VALUE", :value -32768, :bytes [103 128 0]}
{:form "Short/MAX_VALUE", :value 32767, :bytes [104 127 255]}
{:form "Integer... | null | https://raw.githubusercontent.com/pkpkpk/fress/4976ece964a24a14ebdc527bd685bbfbd228c4fd/src/test/fress/samples.cljs | clojure | max int48
;MAX_SAFE_INT
MAX_SAFE_INT++
MIN_SAFE_INTEGER
"urn:oasis:names:specification:docbook:dtd:xml:4.1." | (ns fress.samples
(:require-macros [fress.test-macros :as mac])
(:require [cljs.tools.reader :refer [read-string]]
[fress.util :as util]))
(def int-samples
[{:form "Short/MIN_VALUE", :value -32768, :bytes [103 128 0]}
{:form "Short/MAX_VALUE", :value 32767, :bytes [104 127 255]}
{:form "Integer... |
801d1cae77f4f996c343acca83d15ff7aa297bedf3b7ce3ef2374fc0970e3034 | mihaimaruseac/hindent | Sort.hs | -- | Import declaration sorting for pretty-printing.
module HIndent.Pretty.Import.Sort
( sortImportsByName
, sortImportsByLocation
) where
import Data.Char
import Data.Function
import Data.List
import Data.Maybe
import GHC.Hs
import GHC.Stack
import GHC.Types.SrcLoc
import HIndent.Pretty.Combinators.Outputable
... | null | https://raw.githubusercontent.com/mihaimaruseac/hindent/06f0a0226dd81b55e596f92365260944b11a3ba7/src/HIndent/Pretty/Import/Sort.hs | haskell | | Import declaration sorting for pretty-printing.
The order of constructors is important. HIndent sorts explicit imports
from ones starting from a capital letter (e.g., data constructors),
symbol identifiers, and functions.
| This function sorts import declarations and explicit imports in them
by their names.
|... | module HIndent.Pretty.Import.Sort
( sortImportsByName
, sortImportsByLocation
) where
import Data.Char
import Data.Function
import Data.List
import Data.Maybe
import GHC.Hs
import GHC.Stack
import GHC.Types.SrcLoc
import HIndent.Pretty.Combinators.Outputable
| The letter type of a ' ' .
data LetterType
= C... |
8c0e59a393149a9fbbd7bcef62bdde0af7ddc7510b326dce17a7e4ac828300ac | racket/gui | queue.rkt | #lang racket/base
(require racket/class
ffi/unsafe
ffi/unsafe/global
ffi/unsafe/schedule
"utils.rkt"
"types.rkt"
"../../lock.rkt"
"../common/queue.rkt"
"../common/freeze.rkt"
"clipboard.rkt"
"const.rkt"
"w32.rkt"
"uniqu... | null | https://raw.githubusercontent.com/racket/gui/ff12969d6a99601f8317f869fcf2f54efa838229/gui-lib/mred/private/wx/gtk/queue.rkt | racket | from common/queue:
------------------------------------------------------------
versions may use a asynchronous mode that somehow doesn't
cooperate with `g_main_context_query` Specifically, the
asynchronous result doesn't wake up a sleeping Racket main
thread, and so the effect of a key is delayed. The following
... | #lang racket/base
(require racket/class
ffi/unsafe
ffi/unsafe/global
ffi/unsafe/schedule
"utils.rkt"
"types.rkt"
"../../lock.rkt"
"../common/queue.rkt"
"../common/freeze.rkt"
"clipboard.rkt"
"const.rkt"
"w32.rkt"
"uniqu... |
50ca30207aadd9adc6d1a894b1d61968bc7bfb529f6d38bf78d418dacdd88eb7 | wesen/ruinwesen | products.lisp | (in-package :ruinwesen)
(define-persistent-class preorder ()
((name :read)
(email :read)
(country :read)
(form-factor :read)
(device :read)
(text :read)))
(defun all-rw-preorders ()
(store-objects-with-class 'preorder))
(defun preorders-to-csv (file &optional (weeks 1))
(let ((since (- (get-univ... | null | https://raw.githubusercontent.com/wesen/ruinwesen/9f3ccea85425cf46b57e76144b3114ca342bad0f/ruinwesen/src/products.lisp | lisp | (in-package :ruinwesen)
(define-persistent-class preorder ()
((name :read)
(email :read)
(country :read)
(form-factor :read)
(device :read)
(text :read)))
(defun all-rw-preorders ()
(store-objects-with-class 'preorder))
(defun preorders-to-csv (file &optional (weeks 1))
(let ((since (- (get-univ... | |
afa1055cb95ca7002fb2684ede320f1bb92d319d7e6584d29b5612169b12ec33 | drapanjanas/pneumatic-tubes | config.cljs | (ns group-chat.config)
(def debug?
^boolean js/goog.DEBUG)
(when debug?
(enable-console-print!))
| null | https://raw.githubusercontent.com/drapanjanas/pneumatic-tubes/ea3834ea04e06cd2d4a03da333461a474c0475f5/examples/group-chat/src/cljs/group_chat/config.cljs | clojure | (ns group-chat.config)
(def debug?
^boolean js/goog.DEBUG)
(when debug?
(enable-console-print!))
| |
41e975cd63eccf38b0df76f3a5b68643bca513a0faec95e5811b168757702ec2 | haskell-github/github | SearchRepos.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import qualified GitHub
import Control.Monad (forM_)
import Data.Maybe (fromMaybe)
import Data.Monoid ((<>))
import Data.List (intercalate)
import System.Environment (getArgs)
import Text.Printf (printf)
import Data.Time.Clock (getCurrentTime, UTCTime(..))
import Da... | null | https://raw.githubusercontent.com/haskell-github/github/d9ac0c7ffbcc720a24d06f0a96ea4e3891316d1a/samples/Search/SearchRepos.hs | haskell | # LANGUAGE OverloadedStrings # | module Main where
import qualified GitHub
import Control.Monad (forM_)
import Data.Maybe (fromMaybe)
import Data.Monoid ((<>))
import Data.List (intercalate)
import System.Environment (getArgs)
import Text.Printf (printf)
import Data.Time.Clock (getCurrentTime, UTCTime(..))
import Data.Time.LocalTime (utc,utcToLocalTi... |
61554d0cfd0d6a34b3fcae902fe3f3f5c95ce217f6d7fddd544276cd35e9c710 | herd/herdtools7 | relax.ml | (****************************************************************************)
(* the diy toolsuite *)
(* *)
, University College London , UK .
, INRIA Par... | null | https://raw.githubusercontent.com/herd/herdtools7/b86aec8db64f8812e19468893deb1cdf5bbcfb83/gen/relax.ml | ocaml | **************************************************************************
the diy toolsuite
en Automatique and ... | , University College London , UK .
, INRIA Paris - Rocquencourt , France .
Copyright 2010 - present Institut National de Recherche en Informatique et
This software is governed by the CeCILL - B license under French law and
modify and/ or redistribu... |
83ec9264849a311435b0358716f42d30599540dbe8cd239583cd812a79af2d52 | sadiqj/http-effects | httpaf_effects.ml | open Httpaf
let debug = false
let dprintf s =
if debug then begin
Printf.printf "[%d] " (Aeio.get_tid ());
Printf.printf s
end else
Printf.ifprintf stdout s
exception Partial
let read_buffer_size = 4096
let create_connection_handler ?config request_handler =
fun fd _ ->
let conn = Server_con... | null | https://raw.githubusercontent.com/sadiqj/http-effects/ae2824b5331e922a7f03eeda2bef837bf18551d9/httpaf_effects.ml | ocaml | TODO: Aeio.writev | open Httpaf
let debug = false
let dprintf s =
if debug then begin
Printf.printf "[%d] " (Aeio.get_tid ());
Printf.printf s
end else
Printf.ifprintf stdout s
exception Partial
let read_buffer_size = 4096
let create_connection_handler ?config request_handler =
fun fd _ ->
let conn = Server_con... |
9dc90df387c2a82c61508bcd5678de87c05b3762a7c4d9cf5e54ac01d26ccb45 | Yuppiechef/cqrs-server | onyx.clj | (ns cqrs-server.onyx
(:require
[onyx.api]
[clojure.tools.logging :as log]
[cqrs-server.util :as util]
[onyx.peer.task-lifecycle-extensions :as l-ext]))
(defn lifecycle-resource [ident resource-fn]
(defmethod l-ext/inject-lifecycle-resources ident [_ pipeline-data]
(resource-fn (:onyx.core/task-map ... | null | https://raw.githubusercontent.com/Yuppiechef/cqrs-server/57621f52e8f4a9de9f2e06fff16b4b918a81228a/src/cqrs_server/onyx.clj | clojure | (ns cqrs-server.onyx
(:require
[onyx.api]
[clojure.tools.logging :as log]
[cqrs-server.util :as util]
[onyx.peer.task-lifecycle-extensions :as l-ext]))
(defn lifecycle-resource [ident resource-fn]
(defmethod l-ext/inject-lifecycle-resources ident [_ pipeline-data]
(resource-fn (:onyx.core/task-map ... | |
a0b099d70dd22f391bf6a4ef1894ee3c025a722a140d375b3e34ae055e01cccc | SKA-ScienceDataProcessor/RC | test.hs |
# LANGUAGE BangPatterns , ScopedTypeVariables , CPP #
module Main where
import Control.Monad
import Control.Monad.Primitive
import Profiling.Linux.Perf.Stat
import Data.Time.Clock
import Data.Word
import Text.Printf
import qualified Data.Vector.Storable as V
import qualified Data.Vector.Storable.Mutable as VM
imp... | null | https://raw.githubusercontent.com/SKA-ScienceDataProcessor/RC/1b5e25baf9204a9f7ef40ed8ee94a86cc6c674af/MS4/dep/linux-perf-stat/src/test.hs | haskell | Prepare mutable versions for transfer test
Warm up, and prevent full laziness
Run loop
Show stats |
# LANGUAGE BangPatterns , ScopedTypeVariables , CPP #
module Main where
import Control.Monad
import Control.Monad.Primitive
import Profiling.Linux.Perf.Stat
import Data.Time.Clock
import Data.Word
import Text.Printf
import qualified Data.Vector.Storable as V
import qualified Data.Vector.Storable.Mutable as VM
imp... |
4e2457a33ef72024d4a11630fc5d08a4c28a8a2b410201a70fdf9420835d0160 | k-bx/protocol-buffers | a.hs | module A(A(..),akeybc,akeycb) where
import B(B)
import B(bkeyac)
import C(C)
import C(ckeyab)
data A = A { name :: String }
akeybc :: Either B (Maybe C)
akeybc = Right Nothing
akeycb :: Either C (Maybe B)
akeycb = Right Nothing
instance Show A where
show a = [name a,show bkeyac,show ckeyab]
| null | https://raw.githubusercontent.com/k-bx/protocol-buffers/89425795ac2d560c5d690714e7d206ba9f97aff2/tests/recursive/test-case/a.hs | haskell | module A(A(..),akeybc,akeycb) where
import B(B)
import B(bkeyac)
import C(C)
import C(ckeyab)
data A = A { name :: String }
akeybc :: Either B (Maybe C)
akeybc = Right Nothing
akeycb :: Either C (Maybe B)
akeycb = Right Nothing
instance Show A where
show a = [name a,show bkeyac,show ckeyab]
| |
36e7f4a80a1d53d24ed00fe5f9f63fb41c61f60f47269a1f6d6d3bb4563b1e5a | dbuenzli/sexpm | test_codec.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... | null | https://raw.githubusercontent.com/dbuenzli/sexpm/4ea5218bbe3419b5c594c0aa7b037ddc88797ad5/test/test_codec.ml | ocaml | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... | |
9116d81544173361360072b2cee1ce4e681e69e7d766d4257e3b96c9c1e9f823 | intermine/bluegenes | ids.clj | (ns bluegenes.ws.ids
(:require [compojure.core :refer [GET POST defroutes]]
[ring.util.http-response :as response]
[config.core :refer [env]]
[clojure.pprint :refer [pprint]]
[clojure.string :refer [lower-case]]
[ring.middleware.multipart-params :refer [wrap... | null | https://raw.githubusercontent.com/intermine/bluegenes/417ea23b2d00fdca20ce4810bb2838326a09010e/src/clj/bluegenes/ws/ids.clj | clojure |
These services bulk-parse IDs on the server side, for the upload / idresolver
SEE bluegenes/src/cljs/bluegenes/components/idresolver/README.md for details
Uber threading!
Build a re-find function using the matcher
Repeatedly call it forever
That is until we no longer have a value
There's a lot going on here:
... | (ns bluegenes.ws.ids
(:require [compojure.core :refer [GET POST defroutes]]
[ring.util.http-response :as response]
[config.core :refer [env]]
[clojure.pprint :refer [pprint]]
[clojure.string :refer [lower-case]]
[ring.middleware.multipart-params :refer [wrap... |
074c8153baf32bf77bede9023efac60d8d5f7304d7606b38015ac1133c0077b3 | typelead/eta | T2799.hs | {-# OPTIONS -XGADTs #-}
module RepAux (
toSpineRl
) where
data MTup l where
P :: MTup l -> MTup (a,l)
data Spine a where
S :: Spine (a -> b) -> Spine b
toSpineRl :: MTup l -> l -> (l -> a) -> Spine a
toSpineRl (P rs) (a, l) into = S (toSpineRl rs l into')
where
into' tl1 x1 = into (x1,tl1)
| null | https://raw.githubusercontent.com/typelead/eta/97ee2251bbc52294efbf60fa4342ce6f52c0d25c/tests/suite/typecheck/compile/T2799.hs | haskell | # OPTIONS -XGADTs # |
module RepAux (
toSpineRl
) where
data MTup l where
P :: MTup l -> MTup (a,l)
data Spine a where
S :: Spine (a -> b) -> Spine b
toSpineRl :: MTup l -> l -> (l -> a) -> Spine a
toSpineRl (P rs) (a, l) into = S (toSpineRl rs l into')
where
into' tl1 x1 = into (x1,tl1)
|
500ac89f4014de8918d560ecbc43512ad4a344b9090de374375a14b967e4307f | totakke/libra | bench_test.clj | (ns libra.bench-test
(:require [clojure.test :refer :all]
[clojure.test.check :as tc]
[clojure.test.check.clojure-test :refer [defspec]]
[clojure.test.check.generators :as gen]
[clojure.test.check.properties :as prop]
[libra.bench :as b]))
(deftest format-t... | null | https://raw.githubusercontent.com/totakke/libra/dce129caf930cf502db26331ef1333ce22501a82/libra/test/libra/bench_test.clj | clojure | (ns libra.bench-test
(:require [clojure.test :refer :all]
[clojure.test.check :as tc]
[clojure.test.check.clojure-test :refer [defspec]]
[clojure.test.check.generators :as gen]
[clojure.test.check.properties :as prop]
[libra.bench :as b]))
(deftest format-t... | |
3fa06ec636b2f8f65f7adb05c467007e133b2dba1276d5af85444a494b4913b0 | na4zagin3/satyrographos | command_install__distWithBrokenHash.ml | module StdList = List
open Satyrographos_testlib
open TestLib
open Shexp_process
let env ~dest_dir:_ ~temp_dir : Satyrographos.Environment.t t =
let open Shexp_process.Infix in
let dist_dir = FilePath.concat temp_dir "simple_dist" in
PrepareDist.simple dist_dir
>> stdout_to (FilePath.concat dist_dir "hash/br... | null | https://raw.githubusercontent.com/na4zagin3/satyrographos/9dbccf05138510c977a67c859bbbb48755470c7f/test/testcases/command_install__distWithBrokenHash.ml | ocaml | YoJson 1.7.0
YoJson 1.4.1+satysfi | module StdList = List
open Satyrographos_testlib
open TestLib
open Shexp_process
let env ~dest_dir:_ ~temp_dir : Satyrographos.Environment.t t =
let open Shexp_process.Infix in
let dist_dir = FilePath.concat temp_dir "simple_dist" in
PrepareDist.simple dist_dir
>> stdout_to (FilePath.concat dist_dir "hash/br... |
11c892439f34ac12aa10c4d984ca3727532be84dd1c02e1cf50cd80285cdcd07 | ghc/nofib | StmTest.hs | module Main where
import Control.Concurrent
import Control.Concurrent.STM
import System.IO
data State = State {
vt :: TVar Int,
vm :: MVar Int,
chan :: TChan (),
count :: TVar Int
}
loopmax = 100000
numthreads = 50
main
= do t <- atomically (newTVar 0)
m <- newEmptyMVar
putMVar m 0
... | null | https://raw.githubusercontent.com/ghc/nofib/f34b90b5a6ce46284693119a06d1133908b11856/smp/stm001/StmTest.hs | haskell | module Main where
import Control.Concurrent
import Control.Concurrent.STM
import System.IO
data State = State {
vt :: TVar Int,
vm :: MVar Int,
chan :: TChan (),
count :: TVar Int
}
loopmax = 100000
numthreads = 50
main
= do t <- atomically (newTVar 0)
m <- newEmptyMVar
putMVar m 0
... | |
1a93c80c085b22c970f1b7ee8e92e4d1bd7d39ea912b247d42b0d1f12b451ef2 | racket/typed-racket | submodule-list-1.rkt | #;
(exn-pred exn:fail:contract? #rx"shape-check")
#lang typed/racket/base/shallow
(module u racket/base
(define x* "OOPS")
(provide x*))
(require/typed 'u
(x* (Listof Integer)))
| null | https://raw.githubusercontent.com/racket/typed-racket/1dde78d165472d67ae682b68622d2b7ee3e15e1e/typed-racket-test/fail/shallow/submodule-list-1.rkt | racket | (exn-pred exn:fail:contract? #rx"shape-check")
#lang typed/racket/base/shallow
(module u racket/base
(define x* "OOPS")
(provide x*))
(require/typed 'u
(x* (Listof Integer)))
| |
11617ceac9967051c14817a95094a343eb4376415e62e9e363c195193464683f | mmottl/aifad | is_entropy.ml |
AIFAD - Automated Induction of Functions over
Author :
email :
WWW :
Copyright ( C ) 2002 Austrian Research Institute for Artificial Intelligence
Copyright ( C ) 2003-
This library is free software ; you can redistribute it and/or
modify it under the terms of t... | null | https://raw.githubusercontent.com/mmottl/aifad/b06786f5cd60992548405078a903ee3d962ea969/src/is_entropy.ml | ocaml |
AIFAD - Automated Induction of Functions over
Author :
email :
WWW :
Copyright ( C ) 2002 Austrian Research Institute for Artificial Intelligence
Copyright ( C ) 2003-
This library is free software ; you can redistribute it and/or
modify it under the terms of t... | |
147f90b27e1ea6089fd2ab206d2e0d9208b61ed74b841b5145e6b9bd1fe0a36b | wargrey/graphics | gradient.rkt | #lang racket
(provide (all-defined-out))
(require "../../digitama/unsafe/pangocairo.rkt")
;;; /
(define (cairo-gradient xc yc radius light shadow density)
(define-values (width height) (values (* (max xc radius) 2.0) (* (max yc radius) 2.0)))
(define-values (bmp cr) (make-cairo-image width height density #true)... | null | https://raw.githubusercontent.com/wargrey/graphics/50751297f244a01ac734099b9a1e9be97cd36f3f/bitmap/tamer/cairo/gradient.rkt | racket | / | #lang racket
(provide (all-defined-out))
(require "../../digitama/unsafe/pangocairo.rkt")
(define (cairo-gradient xc yc radius light shadow density)
(define-values (width height) (values (* (max xc radius) 2.0) (* (max yc radius) 2.0)))
(define-values (bmp cr) (make-cairo-image width height density #true))
(... |
06cb02563ffc515ed079eb0054b85798f53b1f323dd6d03391424236b8604eda | facebook/infer | PulseModelsJava.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/facebook/infer/4ee1c2a8e783ee770b61547a38ff1715d6ed75fe/infer/src/pulse/PulseModelsJava.ml | ocaml | naively modeled as shallow copy.
{curr -> v_c} is modified to {curr -> v_fresh} and returns array[v_c]
{curr -> v_c } is modified to {curr -> v_fresh} and writes to array[v_c]
The empty field is initially set to true
mark the remove element as always reachable
in maps, every new value is marked as always rea... |
* 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
... |
1453e772eea270c9832bb717846424149e4d9e794c437dad2232e08c6f99625d | svenpanne/EOPL3 | exercise-2-08.rkt | #lang eopl
; ------------------------------------------------------------------------------
Exercise 2.8
(define empty-env?-a-list null?)
| null | https://raw.githubusercontent.com/svenpanne/EOPL3/3fc14c4dbb1c53a37bd67399eba34cea8f8234cc/chapter2/exercise-2-08.rkt | racket | ------------------------------------------------------------------------------ | #lang eopl
Exercise 2.8
(define empty-env?-a-list null?)
|
3f0b1a3486e3cc175bf3a89cc59982f77747f1bd905e3e8e6bbe5d284394cd32 | lamdu/lamdu | Gui.hs | module Test.Lamdu.Gui where
import Control.Monad.Once (OnceT)
import Control.Monad.Trans.FastWriter (runWriterT)
import qualified Control.Lens as Lens
import Data.List (group, sort)
import qualified Data.Property as Property
import qualified Graphics.UI.GLFW as GLFW
import GHC.S... | null | https://raw.githubusercontent.com/lamdu/lamdu/5b15688e53ccbf7448ff11134b3e51ed082c6b6c/test/Test/Lamdu/Gui.hs | haskell | We ignore whether execute button was clicked
When trying to figure out which event is selected,
this is a good place to "traceM (show (r ^? Lens._Just . E.dhDoc))"
dummy | module Test.Lamdu.Gui where
import Control.Monad.Once (OnceT)
import Control.Monad.Trans.FastWriter (runWriterT)
import qualified Control.Lens as Lens
import Data.List (group, sort)
import qualified Data.Property as Property
import qualified Graphics.UI.GLFW as GLFW
import GHC.S... |
1637eb8be7b14690d432455cb922cafdfa410b66a471cb7deb50bed090071ff7 | skanev/playground | 12.scm | EOPL exercise 2.12
;
Implement the stack data type of exercise 2.4 using a procedural
; representation.
; I just don't get this. Anyway.
(define (empty-stack? stack)
(stack (lambda (top rest) (null? rest))))
(define (empty-stack)
(lambda (proc)
(proc #f '())))
(define (push val stack)
(lambda (proc)
... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/eopl/02/12.scm | scheme |
representation.
I just don't get this. Anyway. | EOPL exercise 2.12
Implement the stack data type of exercise 2.4 using a procedural
(define (empty-stack? stack)
(stack (lambda (top rest) (null? rest))))
(define (empty-stack)
(lambda (proc)
(proc #f '())))
(define (push val stack)
(lambda (proc)
(proc val stack)))
(define (pop stack)
(stack (... |
a583b8b52b827b89b6fc809a24a4275890b71088ffe4b099f3d1ac0937d0d7ac | ghc/testsuite | T3613.hs | c.f Trac # 3613
module T3613 where
import Control.Monad
foo :: Maybe ()
foo = return ()
bar :: IO ()
bar = return ()
fun1 = let fooThen m = foo>> m
in fooThen (bar>> undefined)
fun2 = let fooThen m = foo>> m
in fooThen (do {bar; undefined})
| null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_fail/T3613.hs | haskell | c.f Trac # 3613
module T3613 where
import Control.Monad
foo :: Maybe ()
foo = return ()
bar :: IO ()
bar = return ()
fun1 = let fooThen m = foo>> m
in fooThen (bar>> undefined)
fun2 = let fooThen m = foo>> m
in fooThen (do {bar; undefined})
| |
f46384516484f506dddedafc20e98f107df95a67b9c504539e18ca3a07967433 | dreixel/syb | FoldTree.hs | {-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE ScopedTypeVariables #
A very , very simple example : " extract all Ints from a tree of Ints " .
The text book approach is to write a generalised fold for that . One
can also turn the datatype into functorial style and then write a
Functor instance for the funct... | null | https://raw.githubusercontent.com/dreixel/syb/f741a437f18768f71586eeb47ffb43c0915f331b/tests/FoldTree.hs | haskell | # LANGUAGE DeriveDataTypeable #
Enable "ScrapYourBoilerplate"
A parameterised datatype for binary trees with data at the leafs
A typical tree
A less typical tree, used for testing everythingBut
Print everything like an Int in mytree | # LANGUAGE ScopedTypeVariables #
A very , very simple example : " extract all Ints from a tree of Ints " .
The text book approach is to write a generalised fold for that . One
can also turn the datatype into functorial style and then write a
Functor instance for the functorial datatype including a definition... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.