_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 |
|---|---|---|---|---|---|---|---|---|
622e20affa6eac5796a631e40ece7f8268172a561a1b2a0c1f71cbae4a7247bc | Chris00/mesh | discover.ml | module C = Configurator.V1
let configure t =
let system_libtriangle =
(* Test the presence of the header file. *)
C.c_test t ~link_flags:["-ltriangle"]
"#include <triangle.h>
int main() {
return 0;
}" in
let ccopt, cclib =
if system_libtriangle then
(* System with lib... | null | https://raw.githubusercontent.com/Chris00/mesh/a998a3d898b0013517a5f7f6078791b61e6a0fe2/triangle/config/discover.ml | ocaml | Test the presence of the header file.
System with libtriangle | module C = Configurator.V1
let configure t =
let system_libtriangle =
C.c_test t ~link_flags:["-ltriangle"]
"#include <triangle.h>
int main() {
return 0;
}" in
let ccopt, cclib =
if system_libtriangle then
["-DTRILIBRARY"; "-DEXTERNAL_TEST"; "-DANSI_DECLARATORS";
"... |
d948ce33b01cfc0fd345bccb23c453ad849a77ea88e6b2250da5c9417fb7d11c | lthms/spatial-sway | workspace_id.ml | type t = Index of int | Name of string
type workspace_id = t
let decoder =
let open Json_decoder in
let open Syntax in
let+ str = string in
match int_of_string_opt str with Some id -> Index id | None -> Name str
| null | https://raw.githubusercontent.com/lthms/spatial-sway/7f8430cb34007d71da9b2718027c9e2758ac59ad/lib/sway_ipc_types/workspace_id.ml | ocaml | type t = Index of int | Name of string
type workspace_id = t
let decoder =
let open Json_decoder in
let open Syntax in
let+ str = string in
match int_of_string_opt str with Some id -> Index id | None -> Name str
| |
1c0053a8b66b5c56e70432bdbd92b33f3f93251e820e895ff916930da1516595 | fragnix/fragnix | System.Posix.Directory.ByteString.hs | {-# LANGUAGE Haskell2010 #-}
{-# LINE 1 "dist/dist-sandbox-261cd265/build/System/Posix/Directory/ByteString.hs" #-}
# LINE 1 " System / Posix / Directory / ByteString.hsc " #
# LANGUAGE CApiFFI #
# LINE 2 " System / Posix / Directory / ByteString.hsc " #
# LANGUAGE NondecreasingIndentation #
# LINE 4 " System / Posix ... | null | https://raw.githubusercontent.com/fragnix/fragnix/b9969e9c6366e2917a782f3ac4e77cce0835448b/tests/packages/scotty/System.Posix.Directory.ByteString.hs | haskell | # LANGUAGE Haskell2010 #
# LINE 1 "dist/dist-sandbox-261cd265/build/System/Posix/Directory/ByteString.hs" #
# LANGUAGE Safe #
---------------------------------------------------------------------------
|
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : provisional
Port... | # LINE 1 " System / Posix / Directory / ByteString.hsc " #
# LANGUAGE CApiFFI #
# LINE 2 " System / Posix / Directory / ByteString.hsc " #
# LANGUAGE NondecreasingIndentation #
# LINE 4 " System / Posix / Directory / ByteString.hsc " #
# LINE 8 " System / Posix / Directory / ByteString.hsc " #
Module : Sys... |
9c30b42d297acdd3979fad76873e847c064877535e75399a110fd5c8b95929ba | Frama-C/Frama-C-snapshot | warn.ml | (**************************************************************************)
(* *)
This file is part of Frama - C.
(* *)
Copyright ... | null | https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/value/domains/cvalue/warn.ml | ocaml | ************************************************************************
alternatives)
... | This file is part of Frama - C.
Copyright ( C ) 2007 - 2019
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , v... |
fe86094304581b92b3fdee3e51039fd34c193316bf6959239bf8cda61bba0000 | Frama-C/Frama-C-snapshot | register.ml | (**************************************************************************)
(* *)
This file is part of Frama - C.
(* *)
Copyright ... | null | https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/impact/register.ml | ocaml | ************************************************************************
alternatives)
... | This file is part of Frama - C.
Copyright ( C ) 2007 - 2019
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , v... |
ff68bb6d735b8b243fce803fc94398fb8807824fda9e86b732584d3370cb6011 | ekmett/machines | Type.hs | {-# LANGUAGE GADTs #-}
{-# LANGUAGE Rank2Types #-}
# LANGUAGE TypeOperators #
# LANGUAGE FlexibleInstances #
-----------------------------------------------------------------------------
-- |
-- Module : Data.Machine.Type
Copyright : ( C ) 2012
-- License : BSD-style (see the file LICENSE)
--
Main... | null | https://raw.githubusercontent.com/ekmett/machines/58e39c953e7961e22765898d29ce1981f8147804/src/Data/Machine/Type.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE Rank2Types #
---------------------------------------------------------------------------
|
Module : Data.Machine.Type
License : BSD-style (see the file LICENSE)
Stability : provisional
--------------------------------------------------------------------------
* Machine... | # LANGUAGE TypeOperators #
# LANGUAGE FlexibleInstances #
Copyright : ( C ) 2012
Maintainer : < >
Portability : rank-2 , GADTs
module Data.Machine.Type
(
MachineT(..)
, Step(..)
, Machine
, runT_
, runT
, run
, runMachine
, encased
, construct
, repeatedly
, unfoldPlan
... |
b9367c16bc5cd7f9de895698c8491d1903ad7747079235bf2d77ea427b424617 | AbstractMachinesLab/caramel | ast_mapper.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/AbstractMachinesLab/caramel/7d4e505d6032e22a630d2e3bd7085b77d0efbb0c/vendor/ocaml-lsp-1.4.0/ocaml-lsp-server/vendor/merlin/upstream/ocaml_405/parsing/ast_mapper.mli | ocaml | ************************************************************************
OCaml
... | , LexiFi
Copyright 2012 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
* The interface of a -ppx rewriter
A -ppx rewriter is a program that accepts a serialized abstract sy... |
5d8652da799fe515504faeca104038a77f7c4a0e323b5ad16b8b94b6342be832 | soulomoon/haskell-katas | ScottEncoding.hs | {-# LANGUAGE ScopedTypeVariables, Rank2Types #-}
module Kyu1.ScottEncoding where
import Prelude hiding (null, length, map, foldl, foldr, take, fst, snd, curry, uncurry, concat, zip, (++))
newtype SMaybe a = SMaybe { runMaybe :: forall b. b -> (a -> b) -> b }
newtype SList a = SList { runList :: forall b. b -> (a -> S... | null | https://raw.githubusercontent.com/soulomoon/haskell-katas/0861338e945e5cbaadf98138cf8f5f24a6ca8bb3/src/Kyu1/ScottEncoding.hs | haskell | # LANGUAGE ScopedTypeVariables, Rank2Types # | module Kyu1.ScottEncoding where
import Prelude hiding (null, length, map, foldl, foldr, take, fst, snd, curry, uncurry, concat, zip, (++))
newtype SMaybe a = SMaybe { runMaybe :: forall b. b -> (a -> b) -> b }
newtype SList a = SList { runList :: forall b. b -> (a -> SList a -> b) -> b }
newtype SEither a b = SEither... |
ed2bb5e9d4ca68d2d15c1dd9d364ac274b6e4e3a3d44a36a9c3b11d1390f1e3a | robert-strandh/Cluster | packages.lisp | (cl:in-package #:common-lisp-user)
(defpackage #:cluster.disassembler
(:use #:common-lisp)
(:local-nicknames
(#:c #:cluster))
(:export
#:make-interpreter
#:make-debug-interpreter
#:*x86-table*
#:decode-instruction
#:decode-sequence
#:instruction-descriptor
#:start-position))
| null | https://raw.githubusercontent.com/robert-strandh/Cluster/370410b1c685f2afd77f959a46ba49923a31a33c/Disassembler/packages.lisp | lisp | (cl:in-package #:common-lisp-user)
(defpackage #:cluster.disassembler
(:use #:common-lisp)
(:local-nicknames
(#:c #:cluster))
(:export
#:make-interpreter
#:make-debug-interpreter
#:*x86-table*
#:decode-instruction
#:decode-sequence
#:instruction-descriptor
#:start-position))
| |
0f6d7bb0c8da288f24efb96736ff93b4b57ce8c9200079f1250c3043bfb1dd9a | unison-code/unison | MinimalRegisterClassDecl.hs | This file has been generated by specsgen . Do not modify by hand !
module Unison.Target.Minimal.SpecsGen.MinimalRegisterClassDecl
(MinimalRegisterClass(..)) where
data MinimalRegisterClass = M32
| R32
deriving (Eq, Ord, Read, Show)
| null | https://raw.githubusercontent.com/unison-code/unison/9f8caf78230f956a57b50a327f8d1dca5839bf64/src/unison/src/Unison/Target/Minimal/SpecsGen/MinimalRegisterClassDecl.hs | haskell | This file has been generated by specsgen . Do not modify by hand !
module Unison.Target.Minimal.SpecsGen.MinimalRegisterClassDecl
(MinimalRegisterClass(..)) where
data MinimalRegisterClass = M32
| R32
deriving (Eq, Ord, Read, Show)
| |
e18e1eeb31ac9d6b694e6e9994a72c6c66a1d27bae61d32faf26f16bbe815272 | BillHallahan/G2 | Support.hs | # LANGUAGE FunctionalDependencies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
# LANGUAGE UndecidableInstances #
module G2.Language.Monad.Support ( StateT
, StateM
, StateNGT
... | null | https://raw.githubusercontent.com/BillHallahan/G2/3bf78e2d413b458b896f16d8bf4abc5edb9eb9b7/src/G2/Language/Monad/Support.hs | haskell | See G2.Initialization.Types), or so that we can just use it with smaller
pieces of a state.
| Allows access to certain basic components of a state.
components in the `State`. | # LANGUAGE FunctionalDependencies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
# LANGUAGE UndecidableInstances #
module G2.Language.Monad.Support ( StateT
, StateM
, StateNGT
... |
2d267a3632c3e3f87c378abeaf73eff5cb9f162ac154a212304fde2575339d90 | waldheinz/bling | Progress.hs |
module Graphics.Bling.IO.Progress (
(<&>), progressWriter
) where
import System.FilePath
import Text.Printf
import Graphics.Bling.IO.Bitmap
import Graphics.Bling.Rendering
| allows to combine two progress reporters into a new one . the new
-- reporter will request continued operation iff both of the provi... | null | https://raw.githubusercontent.com/waldheinz/bling/1f338f4b8dbd6a2708cb10787f4a2ac55f66d5a8/src/lib/Graphics/Bling/IO/Progress.hs | haskell | reporter will request continued operation iff both of the provided
reporters did so
| a progress reporter which will write every complete rendering pass to
a separate, numbered file
^ the basename, will get pass number and extension appended |
module Graphics.Bling.IO.Progress (
(<&>), progressWriter
) where
import System.FilePath
import Text.Printf
import Graphics.Bling.IO.Bitmap
import Graphics.Bling.Rendering
| allows to combine two progress reporters into a new one . the new
(<&>) :: ProgressReporter -> ProgressReporter -> ProgressReporter
(<... |
5c140abfc4986c81db9c41d59dc2fdbc94c472bc78c182081c1f935c8d4d9d67 | master/ejabberd | node_private.erl | %%% ====================================================================
` ` The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%%% compliance with the License. You should have received a copy of the
%%% Erlang Public License ... | null | https://raw.githubusercontent.com/master/ejabberd/9c31874d5a9d1852ece1b8ae70dd4b7e5eef7cf7/src/mod_pubsub/node_private.erl | erlang | ====================================================================
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved via the world wide web at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
th... | ` ` The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
The Initial Developer of the Original Code is ProcessOne .
Portions created by ProcessOne are C... |
30de69684ce056df8595a8ebc8020c80367636ffdd1c86bc6362b1bc05678ad9 | digital-asset/ghc | T15552.hs | # LANGUAGE DataKinds , ExistentialQuantification , GADTs , PolyKinds , TypeOperators #
# LANGUAGE TypeInType , TypeFamilies #
module T15552 where
import Data.Kind
data Elem :: k -> [k] -> Type
data EntryOfVal (v :: Type) (kvs :: [Type]) where
EntryOfVal :: forall (v :: Type) (kvs :: [Type]) (k :: Type).
... | null | https://raw.githubusercontent.com/digital-asset/ghc/323dc6fcb127f77c08423873efc0a088c071440a/testsuite/tests/typecheck/should_fail/T15552.hs | haskell | # LANGUAGE DataKinds , ExistentialQuantification , GADTs , PolyKinds , TypeOperators #
# LANGUAGE TypeInType , TypeFamilies #
module T15552 where
import Data.Kind
data Elem :: k -> [k] -> Type
data EntryOfVal (v :: Type) (kvs :: [Type]) where
EntryOfVal :: forall (v :: Type) (kvs :: [Type]) (k :: Type).
... | |
e7cfe14bffa2213b7c84d849ca46da8f27a350e9abd2e39d43cf0b7de7868304 | kowainik/summoner | Template.hs | |
Module : Summoner . Template
Copyright : ( c ) 2017 - 2022 Kowainik
SPDX - License - Identifier : MPL-2.0
Maintainer : < >
Stability : Stable
Portability : Portable
This module contains functions for the project template cr... | null | https://raw.githubusercontent.com/kowainik/summoner/0c03dd0d6ee71c79227974b697f171396d3d09a7/summoner-cli/src/Summoner/Template.hs | haskell | | Creating tree structure of the project. | |
Module : Summoner . Template
Copyright : ( c ) 2017 - 2022 Kowainik
SPDX - License - Identifier : MPL-2.0
Maintainer : < >
Stability : Stable
Portability : Portable
This module contains functions for the project template cr... |
491e3d32699b9488dc41780f2ba2105e42c3dda61aa55dce2e3b0b5153f7846c | tezos/tezos-mirror | test_sc_rollup_encoding.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2022 Nomadic Labs , < >
(* ... | null | https://raw.githubusercontent.com/tezos/tezos-mirror/6cce98810919826c01005f2ffbd02a2302aa91bb/src/proto_alpha/lib_protocol/test/pbt/test_sc_rollup_encoding.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2022 Nomadic Labs , < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN A... |
40fc08d026aac6fbe00786bf4423f22c05ffc7f371b11bf031bc5b859c8f1569 | jimweirich/sicp-study | ex2_75_test.scm | SICP Tests 2.75
(test-case "Ex 2.75 -- To Radians"
(assert-in-delta 0.707 (to-rad 45) 0.783))
(test-case "Ex 2.75 -- Data Driven Complex Number"
(let ((c (make-from-mag-ang 1 (to-rad 45))))
(assert-equal 1 (c 'magnitude))
(assert-in-delta (to-rad 45) (c 'angle) 0.001... | null | https://raw.githubusercontent.com/jimweirich/sicp-study/bc5190e04ed6ae321107ed6149241f26efc1b8c8/scheme/chapter2/ex2_75_test.scm | scheme | SICP Tests 2.75
(test-case "Ex 2.75 -- To Radians"
(assert-in-delta 0.707 (to-rad 45) 0.783))
(test-case "Ex 2.75 -- Data Driven Complex Number"
(let ((c (make-from-mag-ang 1 (to-rad 45))))
(assert-equal 1 (c 'magnitude))
(assert-in-delta (to-rad 45) (c 'angle) 0.001... | |
8de62b20a0e74e9ead5ea80d32a5cc6f9c35d092e3ef5c39db74c572467019ea | cedlemo/OCaml-GI-ctypes-bindings-generator | Combo_box_text.ml | open Ctypes
open Foreign
type t = unit ptr
let t_typ : t typ = ptr void
let create =
foreign "gtk_combo_box_text_new" (void @-> returning (ptr Widget.t_typ))
let create_with_entry =
foreign "gtk_combo_box_text_new_with_entry" (void @-> returning (ptr Widget.t_typ))
let append =
foreign "gtk_combo_box_text_appen... | null | https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/Gtk3/Combo_box_text.ml | ocaml | open Ctypes
open Foreign
type t = unit ptr
let t_typ : t typ = ptr void
let create =
foreign "gtk_combo_box_text_new" (void @-> returning (ptr Widget.t_typ))
let create_with_entry =
foreign "gtk_combo_box_text_new_with_entry" (void @-> returning (ptr Widget.t_typ))
let append =
foreign "gtk_combo_box_text_appen... | |
2be613487429d5d42bb003b534b08aafab7be02abba31f135a29ff2d09348d08 | bbusching/libgit2 | object.rkt | #lang racket
(require ffi/unsafe
"define.rkt"
"types.rkt"
"buffer.rkt"
"utils.rkt")
(provide (all-defined-out))
(define-libgit2/dealloc git_object_free
(_fun _object -> _void))
(define-libgit2 git_object__size
(_fun _git_otype -> _size))
(define-libgit2/alloc git_object_dup
... | null | https://raw.githubusercontent.com/bbusching/libgit2/6d6a007543900eb7a6fbbeba55850288665bdde5/libgit2/include/object.rkt | racket | #lang racket
(require ffi/unsafe
"define.rkt"
"types.rkt"
"buffer.rkt"
"utils.rkt")
(provide (all-defined-out))
(define-libgit2/dealloc git_object_free
(_fun _object -> _void))
(define-libgit2 git_object__size
(_fun _git_otype -> _size))
(define-libgit2/alloc git_object_dup
... | |
25c8602afef4e7619f6fceb38d9226b7599f4afcdf83a8e842163864b5fc1396 | ucsd-progsys/liquidhaskell | CheckedImp.hs | module CheckedImp where
{-@ relational foo ~ foo :: { x1:_ -> _ ~ x2:_ -> _ | x1 = x2 !=> r1 x1 = r2 x2 } @-}
foo :: Int -> Int
foo = (+1)
{-@ relational bar ~ baz :: { _ ~ _ | r1 = r2 } @-}
bar, baz :: Int
bar = foo 1
baz = foo 1 | null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/177331c811145dab2606bc442389e0031d7db41b/tests/relational/pos/CheckedImp.hs | haskell | @ relational foo ~ foo :: { x1:_ -> _ ~ x2:_ -> _ | x1 = x2 !=> r1 x1 = r2 x2 } @
@ relational bar ~ baz :: { _ ~ _ | r1 = r2 } @ | module CheckedImp where
foo :: Int -> Int
foo = (+1)
bar, baz :: Int
bar = foo 1
baz = foo 1 |
a4e8edbee91720563ac7e26b021137893a7f329cf576450456e7905e10f75715 | cmsc430/www | example.rkt | #lang racket
(if (zero? 1)
(sub1 43)
(if (zero? 0) 1024 2048))
| null | https://raw.githubusercontent.com/cmsc430/www/0809867532b8ef516029ac38093a145db5b424ea/langs/test-programs/con/example.rkt | racket | #lang racket
(if (zero? 1)
(sub1 43)
(if (zero? 0) 1024 2048))
| |
5337edd1516df0cbae0798e7380d5b27c5425325aa6ab9734769f8b9bf4a1812 | LaurentMazare/ocaml-minipy | parse.mli | open Base
module Error : sig
type t =
{ message : string
; context : string option
}
[@@deriving sexp]
end
val token_to_string : Parser.token -> string
val tokens_string : string -> Parser.token list
val tokens_file : string -> Parser.token list
val parse : ?filename:string -> Stdio.In_channel.t -> (A... | null | https://raw.githubusercontent.com/LaurentMazare/ocaml-minipy/e83d4bfad55819a27195109d401437faa0f65f69/src/parse.mli | ocaml | open Base
module Error : sig
type t =
{ message : string
; context : string option
}
[@@deriving sexp]
end
val token_to_string : Parser.token -> string
val tokens_string : string -> Parser.token list
val tokens_file : string -> Parser.token list
val parse : ?filename:string -> Stdio.In_channel.t -> (A... | |
28f7338de6db2c43456d945a8b5ccdbc3b54e266285553cf40480e29493107d9 | racket/racket7 | recur-handler.rkt | #lang racket/base
(require "../port/output-port.rkt"
"mode.rkt")
(provide set-port-handlers-to-recur!)
(define (set-port-handlers-to-recur! port handle)
(set-core-output-port-print-handler! port
(lambda (e p [mode 0])
(handle e... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/src/io/print/recur-handler.rkt | racket | #lang racket/base
(require "../port/output-port.rkt"
"mode.rkt")
(provide set-port-handlers-to-recur!)
(define (set-port-handlers-to-recur! port handle)
(set-core-output-port-print-handler! port
(lambda (e p [mode 0])
(handle e... | |
1d81e9f095c230f53140fa51123e46fa151a63c29c9151709d49af057f63c681 | bos/rwh | HighestClose.hs | {-- snippet closing --}
-- file: HighestClose.hs
import qualified Data.ByteString.Lazy.Char8 as L
closing = readPrice . (!!4) . L.split ','
{-- /snippet closing --}
- snippet -
readPrice :: L.ByteString -> Maybe Int
readPrice str =
case L.readInt str of
Nothing -> Nothing
Just (dollars,r... | null | https://raw.githubusercontent.com/bos/rwh/7fd1e467d54aef832f5476ebf5f4f6a898a895d1/examples/ch09/HighestClose.hs | haskell | - snippet closing -
file: HighestClose.hs
- /snippet closing -
- snippet highestClose - |
import qualified Data.ByteString.Lazy.Char8 as L
closing = readPrice . (!!4) . L.split ','
- snippet -
readPrice :: L.ByteString -> Maybe Int
readPrice str =
case L.readInt str of
Nothing -> Nothing
Just (dollars,rest) ->
case L.readInt (L.tail rest) of
Nothing ... |
76928ff45982afaa5ebdfee6923237e694d5be71b76d0bdea446bc0d174fbb84 | MassD/99 | p66_STAR3.ml |
Layout a binary tree ( 3 ) . ( hard )
-layout3.gif
Yet another layout strategy is shown in the above illustration . The method yields a very compact layout while maintaining a certain symmetry in every node . Find out the rules and write the corresponding predicate .
Hint : Consider the horizontal distance ... | null | https://raw.githubusercontent.com/MassD/99/1d3019eb55b0d621ed1df4132315673dd812b1e1/55-69-binary-tress/p66_STAR3.ml | ocaml | represents the empty tree |
Layout a binary tree ( 3 ) . ( hard )
-layout3.gif
Yet another layout strategy is shown in the above illustration . The method yields a very compact layout while maintaining a certain symmetry in every node . Find out the rules and write the corresponding predicate .
Hint : Consider the horizontal distance ... |
aa371e3064354db1d91baf5c53d7262e82ccd21f706fcc11f1ea6568bc29d5d4 | kmi/irs | load.lisp | Mode : Lisp ; Package :
File created in WebOnto
(in-package "OCML")
(eval-when (eval load)
(ensure-ontology wsmo domain "ocml:library;domains;wsmo;load.lisp" )
(ensure-ontology emergency-gis-situations domain "ocml:library;domains;emergency-gis-situations;load.lisp")
(ensure-ontology sgis-spatial domain "... | null | https://raw.githubusercontent.com/kmi/irs/e1b8d696f61c6b6878c0e92d993ed549fee6e7dd/ontologies/domains/emergency-gis-plume/load.lisp | lisp | Package : |
File created in WebOnto
(in-package "OCML")
(eval-when (eval load)
(ensure-ontology wsmo domain "ocml:library;domains;wsmo;load.lisp" )
(ensure-ontology emergency-gis-situations domain "ocml:library;domains;emergency-gis-situations;load.lisp")
(ensure-ontology sgis-spatial domain "ocml:library;domains;sgis-s... |
fff3670e765912cc93b12cefbc8d2bb3d89b350c8528766c781701562d70d892 | aeternity/mnesia_leveled | mnesia_leveled_fallback.erl | %%----------------------------------------------------------------
Copyright ( c ) 2013 - 2016 Klarna AB
%%
This file is provided to you 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
%%
%% ... | null | https://raw.githubusercontent.com/aeternity/mnesia_leveled/11c480b5546ed6087ae688e8596bd596a1f7bdd1/test/mnesia_leveled_fallback.erl | erlang | ----------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissions an... | Copyright ( c ) 2013 - 2016 Klarna AB
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(mnesia_leveled_fallback).
-expo... |
7f0d411bf0ab50f786dc61dea31c4da5b994d152c77f473aa799130867e9d840 | ghorn/spatial-math | LibmFfi.hs | # OPTIONS_GHC -Wall #
module SpatialMath.LibmFfi
( libm_atan2
, libm_atan2f
) where
import Foreign.C.Types ( CDouble(..), CFloat(..) )
foreign import ccall unsafe "math.h atan2" c_atan2
:: CDouble -> CDouble -> CDouble
foreign import ccall unsafe "math.h atan2f" c_atan2f
:: CFloat -> CFloat -> CFloat
lib... | null | https://raw.githubusercontent.com/ghorn/spatial-math/22afc3e91b6bed7e988da3deae6cfde19383192b/src/SpatialMath/LibmFfi.hs | haskell | # OPTIONS_GHC -Wall #
module SpatialMath.LibmFfi
( libm_atan2
, libm_atan2f
) where
import Foreign.C.Types ( CDouble(..), CFloat(..) )
foreign import ccall unsafe "math.h atan2" c_atan2
:: CDouble -> CDouble -> CDouble
foreign import ccall unsafe "math.h atan2f" c_atan2f
:: CFloat -> CFloat -> CFloat
lib... | |
f339434ef9fc8f5213e6e862fb0f1d18c505d465d8910aa39d7b3e5d6b911fea | savonet/ocaml-mm | fft.ml | open Mm_audio
module FFT = Audio.Mono.Analyze.FFT
let () =
let fname = Sys.argv.(1) in
let f = new Audio.IO.Reader.of_wav_file fname in
let oss = new Mm_oss.writer f#channels f#sample_rate in
Printf.printf "Opened WAV file with %d channels at %dHz.\n%!" f#channels
f#sample_rate;
let fft_n = 11 in
let f... | null | https://raw.githubusercontent.com/savonet/ocaml-mm/f931d881512cf3a74399c261aa5877fb69bfe524/examples/fft.ml | ocaml | open Mm_audio
module FFT = Audio.Mono.Analyze.FFT
let () =
let fname = Sys.argv.(1) in
let f = new Audio.IO.Reader.of_wav_file fname in
let oss = new Mm_oss.writer f#channels f#sample_rate in
Printf.printf "Opened WAV file with %d channels at %dHz.\n%!" f#channels
f#sample_rate;
let fft_n = 11 in
let f... | |
0148668b119cfd38ee8f6e0271c6424b85c8e055f9db2709f1a84f142cb58d5b | alexander-yakushev/ns-graph | core.clj | (ns ns-graph.core
"Generate a namespace dependency graph as an image."
(:require [dorothy.core :as dot]
[clojure.string :as s]
[clojure.java.shell :refer [sh]]
[clojure.java.io :as io]
[clojure.pprint :refer [pprint]]
[clojure.data :refer [diff]]
... | null | https://raw.githubusercontent.com/alexander-yakushev/ns-graph/608515958701edcd50c9a101d198bf38a16a2339/src/ns_graph/core.clj | clojure | Set of all processed files is a predicate to check if a file is from
own project.
Enhance include? with checking if the namespace/class belongs to the
project. | (ns ns-graph.core
"Generate a namespace dependency graph as an image."
(:require [dorothy.core :as dot]
[clojure.string :as s]
[clojure.java.shell :refer [sh]]
[clojure.java.io :as io]
[clojure.pprint :refer [pprint]]
[clojure.data :refer [diff]]
... |
5f8f4c82e3f8f30617368199ed8a73e1803cacf53e41aa706aca5252c8c7b76d | cyverse-archive/DiscoveryEnvironmentBackend | containers_test.clj | (ns metadactyl.containers-test
(:use [clojure.test]
[metadactyl.containers]
[korma.core]
[korma.db]
[kameleon.entities])
(:require [clojure.string :as string]))
;;; These tests assume that you have a clean instance of the de
database running locally on port 5432 . It 's recommende... | null | https://raw.githubusercontent.com/cyverse-archive/DiscoveryEnvironmentBackend/7f6177078c1a1cb6d11e62f12cfe2e22d669635b/services/metadactyl-clj/test/metadactyl/containers_test.clj | clojure | These tests assume that you have a clean instance of the de
use the de-db and de-db-loader images to get a database running
with docker. | (ns metadactyl.containers-test
(:use [clojure.test]
[metadactyl.containers]
[korma.core]
[korma.db]
[kameleon.entities])
(:require [clojure.string :as string]))
database running locally on port 5432 . It 's recommended that you
(defdb testdb (postgres {:db "de"
... |
b42f9c87d3e1ca303c44e4df21cebcca7558ded40113fa5f85c45d75529484fd | HealthSamurai/stresty | dropdown_datepicker.cljc | (ns anti.dropdown-datepicker
(:require
[stylo.core :refer [c c?]]
[anti.click-outside]
[anti.date-input :refer [value-format display-format]]
[chrono.calendar]
[chrono.now]
[chrono.core]
[zf.core :as zf]
[zframes.re-frame :as zrf]
[medley.core :as medley]))
(def dropdown-class
... | null | https://raw.githubusercontent.com/HealthSamurai/stresty/130cedde6bf53e07fe25a6b0b13b8bf70846f15a/src-ui/anti/dropdown_datepicker.cljc | clojure | (ns anti.dropdown-datepicker
(:require
[stylo.core :refer [c c?]]
[anti.click-outside]
[anti.date-input :refer [value-format display-format]]
[chrono.calendar]
[chrono.now]
[chrono.core]
[zf.core :as zf]
[zframes.re-frame :as zrf]
[medley.core :as medley]))
(def dropdown-class
... | |
714802fd80968c16846f58f954ed8d21cb1b91ddbd1f3498364b88f2b6905810 | ailisp/mcclim-graphic-forms | test.lisp | ( in - package : clim - gf )
;;;
;;; (run-frame-top-level (make-application-frame 'buttons))
;;;
(in-package :clim-gf)
(define-application-frame buttons () ()
(:menu-bar nil)
(:layouts
(default
(vertically (:equalize-width t)
(make-pane 'push-button :label "First")))))
(defmethod c... | null | https://raw.githubusercontent.com/ailisp/mcclim-graphic-forms/a81cc6ad95a3ce07a41d3fe72e1f2d5369e45149/temp/test.lisp | lisp |
(run-frame-top-level (make-application-frame 'buttons))
| ( in - package : clim - gf )
(in-package :clim-gf)
(define-application-frame buttons () ()
(:menu-bar nil)
(:layouts
(default
(vertically (:equalize-width t)
(make-pane 'push-button :label "First")))))
(defmethod clim:activate-callback
((button clim:push-button) client gadget-id)... |
628e8f58d17d6f9e2bbf812650d56db1c0659464adc46cd060e005c7448f2d48 | rabbitmq/khepri | queries.erl | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%
Copyright © 2021 - 2023 VMware , Inc. or its affiliates . All rights reserved .
%%
-module(queries).
-include_lib("eunit/include/eunit.... | null | https://raw.githubusercontent.com/rabbitmq/khepri/91699e5e0e7224e6cea0841ed05ffc346a115cab/test/queries.erl | erlang |
khepri:get_root/1 is unexported when compiled without `-DTEST'. | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
Copyright © 2021 - 2023 VMware , Inc. or its affiliates . All rights reserved .
-module(queries).
-include_lib("eunit/include/eunit.hrl").... |
176cf217d0fb768388b0e8bea56846740429c29ae3d170c0275a53ac40941316 | racket/draw | lzw.rkt | #lang racket/base
;;; Translated from Skippy for Common Lisp:
;;;
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:
;;;
;;; * Redistributions of source code must... | null | https://raw.githubusercontent.com/racket/draw/a6558bdc18438e784c23d452ffd877dac867a7fd/draw-lib/racket/draw/private/lzw.rkt | racket | Translated from Skippy for Common Lisp:
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclai... | #lang racket/base
Copyright ( c ) 2006 , All Rights Reserved
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ,
I d : lzw.lisp , v 1.11 2007/01/03 22:01:10 xach Exp
(provide lzw-decompress)
(define (make-input-bitstream bst... |
b4b8fd03bc42c5cefb9639276f2f270e2760cafb23335b814a51f02baa2a2cda | tchoutri/pg-entity | DBT.hs | # LANGUAGE CPP #
|
Module : Database . PostgreSQL.Entity . DBT
Copyright : , 2018
, 2021
License : MIT
Maintainer :
Stability : stable
The ' Database . PostgreSQL.Transact . DBT ' plumbing module to handle database queries and pools
Module ... | null | https://raw.githubusercontent.com/tchoutri/pg-entity/50d47c9ea9c747b4e352530cd287f98d41035dd4/src/Database/PostgreSQL/Entity/DBT.hs | haskell | Number of sub-pools
Allowed timeout
Number of connections
| Query wrapper for SQL statements that operate on multiple rows which do not return.
@since 0.0.2.0
| # LANGUAGE CPP #
|
Module : Database . PostgreSQL.Entity . DBT
Copyright : , 2018
, 2021
License : MIT
Maintainer :
Stability : stable
The ' Database . PostgreSQL.Transact . DBT ' plumbing module to handle database queries and pools
Module ... |
26a96368bcbd6aa92bec64e6dd0a041f41288ba9f9df7ac31bf5639dfa6e1757 | tree-sitter/haskell-tree-sitter | Test.hs | module Main (main) where
import Control.Monad
import System.Exit (exitFailure)
import System.IO (BufferMode (..), hSetBuffering, stderr, stdout)
import qualified TreeSitter.Example
import qualified TreeSitter.Strings.Example
main :: IO ()
main = do
hSetBuffering stdout LineBuffering
hSetBuffering stderr LineBuff... | null | https://raw.githubusercontent.com/tree-sitter/haskell-tree-sitter/8a5a2b12a3c36a8ca7e117fff04023f1595e04e7/tree-sitter/test/Test.hs | haskell | module Main (main) where
import Control.Monad
import System.Exit (exitFailure)
import System.IO (BufferMode (..), hSetBuffering, stderr, stdout)
import qualified TreeSitter.Example
import qualified TreeSitter.Strings.Example
main :: IO ()
main = do
hSetBuffering stdout LineBuffering
hSetBuffering stderr LineBuff... | |
892051f41a095d4939daf321cca03d89fd1092bd55e5de667a5101a98bc20097 | jhidding/chez-glfw | GL_VERSION_2_1.scm | (library (glfw gl GL_VERSION_2_1)
(export
glAccum
glActiveTexture
glAlphaFunc
glAreTexturesResident
glArrayElement
glAttachShader
glBegin
glBeginQuery
glBindAttribLocation
glBindBuffer
glBindTexture
glBitmap
glBlendColor
glBlendEquation
glBlendEquationSepara... | null | https://raw.githubusercontent.com/jhidding/chez-glfw/fe53b5d8915c1c0b9f6a07446a0399a430d09851/glfw/gl/GL_VERSION_2_1.scm | scheme | (library (glfw gl GL_VERSION_2_1)
(export
glAccum
glActiveTexture
glAlphaFunc
glAreTexturesResident
glArrayElement
glAttachShader
glBegin
glBeginQuery
glBindAttribLocation
glBindBuffer
glBindTexture
glBitmap
glBlendColor
glBlendEquation
glBlendEquationSepara... | |
0288b6a54790423c3eaa8b96654bda52c5df816480d407f1eed7936d1ad3ce28 | nirum-lang/nirum | PackageSpec.hs | # LANGUAGE OverloadedLists , OverloadedStrings , QuasiQuotes ,
ScopedTypeVariables #
ScopedTypeVariables #-}
module Nirum.PackageSpec where
import Data.Either (isLeft, isRight)
import Data.Proxy (Proxy (Proxy))
import Data.Text
import System.IO.Error (isDoesNotExistError)
import Data.Map.S... | null | https://raw.githubusercontent.com/nirum-lang/nirum/4d4488b0524874abc6e693479a5cc70c961bad33/test/Nirum/PackageSpec.hs | haskell | # LANGUAGE OverloadedLists , OverloadedStrings , QuasiQuotes ,
ScopedTypeVariables #
ScopedTypeVariables #-}
module Nirum.PackageSpec where
import Data.Either (isLeft, isRight)
import Data.Proxy (Proxy (Proxy))
import Data.Text
import System.IO.Error (isDoesNotExistError)
import Data.Map.S... | |
2e877e608ac1b7aa7aef6bce3f0b09e3298c2bf880b3b77324d4dd64e96cc815 | dpiponi/Moodler | nice1.hs | do
restart
root <- getRoot
let out = "out"
let keyboard = "keyboard"
let trigger = "trigger"
adsr74 <- new' "adsr"
arpeggiator96 <- new' "arpeggiator"
audio_id231 <- new' "audio_id"
audio_id233 <- new' "audio_id"
audio_id234 <- new' "audio_id"
audio_saw7 <- new' "audio_saw"
... | null | https://raw.githubusercontent.com/dpiponi/Moodler/a0c984c36abae52668d00f25eb3749e97e8936d3/Moodler/saves/nice1.hs | haskell | do
restart
root <- getRoot
let out = "out"
let keyboard = "keyboard"
let trigger = "trigger"
adsr74 <- new' "adsr"
arpeggiator96 <- new' "arpeggiator"
audio_id231 <- new' "audio_id"
audio_id233 <- new' "audio_id"
audio_id234 <- new' "audio_id"
audio_saw7 <- new' "audio_saw"
... | |
29a710449330cc5e13cdae462d6fb464c13082f6ee2353b87ec019e0bd2473ec | zotonic/zotonic | validator_base_length.erl | @author < >
2009 - 2017
%% @doc Validator for checking if an input value is within a certain length range
Copyright 2009 - 2017
%%
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 Li... | null | https://raw.githubusercontent.com/zotonic/zotonic/92558e09d4334d16514043c10f66a62c2acb9c6a/apps/zotonic_mod_base/src/validators/validator_base_length.erl | erlang | @doc Validator for checking if an input value is within a certain length range
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, eith... | @author < >
2009 - 2017
Copyright 2009 - 2017
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(validator_base_length).
-include_lib("zotonic_core/include/zotonic.hrl").
-export([render_validator/5, vali... |
05f710ab0a34f817d087eafbb3bfd1675f37f9c72799c33b93196a2198faf993 | ejgallego/coq-lsp | rq_document.mli | (************************************************************************)
(* Coq Language Server Protocol -- Document *)
Copyright 2019 MINES ParisTech -- Dual License LGPL 2.1 / GPL3 +
Copyright 2019 - 2023 Inria -- Dual License LGPL 2.1 / GPL3 +
Written by : ... | null | https://raw.githubusercontent.com/ejgallego/coq-lsp/1881796eb3ed77dc16a8dfc97c547480701b454b/controller/rq_document.mli | ocaml | **********************************************************************
Coq Language Server Protocol -- Document
********************************************************************** | Copyright 2019 MINES ParisTech -- Dual License LGPL 2.1 / GPL3 +
Copyright 2019 - 2023 Inria -- Dual License LGPL 2.1 / GPL3 +
Written by :
val request : Request.document
|
e1433affb0b001cf0f1f1fb302b907b40ff868ffdd14d6793adb8ea5303c84cf | yuriy-chumak/ol | macro.scm | ; already loaded when booting.
(define-library (lang macro)
; remove make-transformer when it is no longer referred
(export macro-expand match make-transformer)
(import
(scheme base)
(srfi 1)
(owl list)
(owl list-extra)
(owl math)
(owl io)
(owl sort)
(lang gen... | null | https://raw.githubusercontent.com/yuriy-chumak/ol/c9eaa54b37ccd175d962703a2a500ecf74cb6859/lang/macro.scm | scheme | already loaded when booting.
remove make-transformer when it is no longer referred
Misc
TEMP
Basic pattern matching for matching the rule pattern against sexp
Matching and rewriting based on rewrite rules
fixme, there are ffs now
store nulls to variables in exp
fixme: we have ffs now
wildcard - match anyt... |
(define-library (lang macro)
(export macro-expand match make-transformer)
(import
(scheme base)
(srfi 1)
(owl list)
(owl list-extra)
(owl math)
(owl io)
(owl sort)
(lang gensym)
(lang env))
(begin
(define (ok exp env) ['ok exp env])
(define... |
8cc73c3c8983ac12e13b57941b2e14c29a65a01d16b8954dce568d163e458542 | bbc/haskell-workshop | C3TypesAndTypeclasses.hs | module C3TypesAndTypeclasses where
-- last, length, and take are all from the standard library, Prelude
You can find out the type in ghci with " : t last " , but attempt to answer first
-- What is the type of the last function?
-- last :: [a] -> a
-- What is the type of the length function?
-- length :: Foldable t... | null | https://raw.githubusercontent.com/bbc/haskell-workshop/475b9bac04167665030d7863798ccd27dfd589d0/jensraaby/exercises/src/C3TypesAndTypeclasses.hs | haskell | last, length, and take are all from the standard library, Prelude
What is the type of the last function?
last :: [a] -> a
What is the type of the length function?
length :: Foldable t => t a -> Int
What is the type of the take function?
take :: Int-> [a] -> [a]
myConcat :: [a] -> [a] -> [a]
Can you use type cl... | module C3TypesAndTypeclasses where
You can find out the type in ghci with " : t last " , but attempt to answer first
myConcat a b = a ++ b
mul : : a = > a - > a - > a
mul a b = a * b
hasShowableInside :: Show a => [a] -> Bool
hasShowableInside xs = null xs
hasNumbersInside :: Num a => [a] -> Bool
hasNumb... |
93cb96065cae11443498b1d4a9dcece294c73a670253d22f5429506c25cb845d | elaforge/karya | MidiThru.hs | Copyright 2013
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or -3.0.txt
# LANGUAGE CPP #
| Implement midi thru by mapping InputNotes to MIDI messages .
This is effectively a recreation of the deriver and MIDI performer , but
geared to producing... | null | https://raw.githubusercontent.com/elaforge/karya/a3675ce9cffe03c58bd71619cae4f0eaf0dddabd/Cmd/MidiThru.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt
* util
| Send midi thru, addressing it to the given Instrument.
Actually, this handles 'Cmd.ImThru' as well, since it relies on the
supercollider is so much simpler than MIDI I can just throw it in here.
I... | Copyright 2013
# LANGUAGE CPP #
| Implement midi thru by mapping InputNotes to MIDI messages .
This is effectively a recreation of the deriver and MIDI performer , but
geared to producing a single note immediately rather than deriving and
performing an entire score . But since derivation and... |
138e96c6b98d7991466ebb8e57ebab4bfe12a294c1d46305732eac982b5c46b4 | alanz/ghc-exactprint | LinearArrow.hs | # LANGUAGE LinearTypes , DataKinds , UnicodeSyntax #
module LinearArrow where
import GHC.Types (Multiplicity(One, Many))
n1 :: a %1 -> b
n1 = undefined
u1 :: a %1 → b
u1 = undefined
n2 :: a %(Many) -> b
n2 = undefined
u2 :: a %(Many) → b
u2 = undefined
m3 :: a ⊸ b
m3 = undefined
n4 :: a %p -> b
n4 = undefine... | null | https://raw.githubusercontent.com/alanz/ghc-exactprint/103bc706c82300639985a15ba6cf762316352c92/tests/examples/ghc92/LinearArrow.hs | haskell | # LANGUAGE LinearTypes , DataKinds , UnicodeSyntax #
module LinearArrow where
import GHC.Types (Multiplicity(One, Many))
n1 :: a %1 -> b
n1 = undefined
u1 :: a %1 → b
u1 = undefined
n2 :: a %(Many) -> b
n2 = undefined
u2 :: a %(Many) → b
u2 = undefined
m3 :: a ⊸ b
m3 = undefined
n4 :: a %p -> b
n4 = undefine... | |
eba907bbe024f6c203425e416238497db724005ab8eb430a67ce1afb043d2e88 | gedge-platform/gedge-platform | rabbit_registry_class.erl | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%
Copyright ( c ) 2016 - 2021 VMware , Inc. or its affiliates . All rights reserved .
%%
-module(rabbit_registry_class).
-callback added_... | null | https://raw.githubusercontent.com/gedge-platform/gedge-platform/97c1e87faf28ba2942a77196b6be0a952bff1c3e/gs-broker/broker-server/deps/rabbit_common/src/rabbit_registry_class.erl | erlang | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
Copyright ( c ) 2016 - 2021 VMware , Inc. or its affiliates . All rights reserved .
-module(rabbit_registry_class).
-callback added_to_rab... | |
84c27f62dcaebf7f8e844d86a0b1b6a0d57205f75164d5d3f153df1d6013e1c8 | korma/Korma | one_to_one.clj | (ns korma.test.integration.one-to-one
(:require clojure.string)
(:use clojure.test
[korma.db :only [defdb h2 default-connection]]
[korma.core :only [defentity pk fk belongs-to has-one transform
exec-raw insert values select with]]))
(defdb mem-db (h2 {:db "mem:one_to_one_... | null | https://raw.githubusercontent.com/korma/Korma/6b76592dd54ba2b03c5862701c8d18a8eea8c040/test/korma/test/integration/one_to_one.clj | clojure | "
"
"]) | (ns korma.test.integration.one-to-one
(:require clojure.string)
(:use clojure.test
[korma.db :only [defdb h2 default-connection]]
[korma.core :only [defentity pk fk belongs-to has-one transform
exec-raw insert values select with]]))
(defdb mem-db (h2 {:db "mem:one_to_one_... |
9aecbbf5181f4d4b82bb3403bcdb1b0812f915705d3953d12348a26a9d59de7a | diasbruno/cl-bnf | common.lisp | (in-package :cl-bnf-tests)
(defun numeric-char-p (char)
(and (char-not-lessp char #\0)
(char-not-greaterp char #\9)))
| null | https://raw.githubusercontent.com/diasbruno/cl-bnf/e545e41519b66aa05c9a441c6c8bb4cff67a9cab/t/common.lisp | lisp | (in-package :cl-bnf-tests)
(defun numeric-char-p (char)
(and (char-not-lessp char #\0)
(char-not-greaterp char #\9)))
| |
a7ef72c6d01b8c0d4781a98e602a37e1e500f8e5cce4fcb858671a44c832bfe9 | restyled-io/restyled.io | Metric.hs | module Restyled.Metric
( Metric(..)
, Unit(..)
, Dimension(..)
) where
import Restyled.Prelude
data Metric n = Metric
{ mName :: Text
, mValue :: n
, mUnit :: Unit
, mDimensions :: [Dimension]
}
instance ToJSON n => ToJSON (Metric n) where
toJSON Metric {..} = object
[... | null | https://raw.githubusercontent.com/restyled-io/restyled.io/7b53f3d485a3d805da946aaf359174ea2f1ddf01/src/Restyled/Metric.hs | haskell | module Restyled.Metric
( Metric(..)
, Unit(..)
, Dimension(..)
) where
import Restyled.Prelude
data Metric n = Metric
{ mName :: Text
, mValue :: n
, mUnit :: Unit
, mDimensions :: [Dimension]
}
instance ToJSON n => ToJSON (Metric n) where
toJSON Metric {..} = object
[... | |
0364f65699fee426f6a5a3589035aefb9dd9b55f2efb73b84b047c145e8d9126 | ghc/testsuite | tcrun009.hs | # LANGUAGE MultiParamTypeClasses , FunctionalDependencies #
-- !!! Functional dependencies
module Main where
class Foo a b | a -> b where
foo :: a -> b
instance Foo [a] (Maybe a) where
foo [] = Nothing
foo (x:_) = Just x
instance Foo (Maybe a) [a] where
foo Nothing = []
foo (Just x) = [x]
... | null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_run/tcrun009.hs | haskell | !!! Functional dependencies
get in effect: test3 (x:xs) = [x] | # LANGUAGE MultiParamTypeClasses , FunctionalDependencies #
module Main where
class Foo a b | a -> b where
foo :: a -> b
instance Foo [a] (Maybe a) where
foo [] = Nothing
foo (x:_) = Just x
instance Foo (Maybe a) [a] where
foo Nothing = []
foo (Just x) = [x]
test3:: [a] -> [a]
test3 = foo ... |
9c4437fa2e13896e1a8441bbeaa6e777f56f10987cddf0c6a80772201920ba65 | skypher/cl-oauth | service-provider.lisp |
(in-package :oauth)
(defvar *protocol-version* :1.0)
;;;; Service provider infrastructure
;;;; TODO: need to store application-specific data somewhere.
(defun finalize-callback-uri (request-token)
"Prepares the callback URI of REQUEST-TOKEN for
redirection."
(let ((uri (request-token-callback-uri request-to... | null | https://raw.githubusercontent.com/skypher/cl-oauth/a7a463c8c2e4726ab0853d5b6623349b6428cb89/src/core/service-provider.lisp | lisp | Service provider infrastructure
TODO: need to store application-specific data somewhere.
signature checking
TODO: do not bluntly ignore all errors. Factor out into GET-TOKEN
now calculate the signature and check for match
nonce and timestamp checking
TODO: nonce checking
version checking
verification code chec... |
(in-package :oauth)
(defvar *protocol-version* :1.0)
(defun finalize-callback-uri (request-token)
"Prepares the callback URI of REQUEST-TOKEN for
redirection."
(let ((uri (request-token-callback-uri request-token)))
(setf (puri:uri-query uri)
(concatenate 'string (or (puri:uri-query uri) "")
... |
a802a0e524cd35798caefce35299a48f4987e66a5bf9fb005bb6439d3dc18479 | hadolint/language-docker | From.hs | module Language.Docker.Parser.From
( parseFrom,
)
where
import qualified Data.Text as T
import Language.Docker.Parser.Prelude
import Language.Docker.Syntax
parseRegistry :: (?esc :: Char) => Parser Registry
parseRegistry = do
domain <- someUnless "a domain name" (== '.')
void $ char '.'
tld <- someUnless "a... | null | https://raw.githubusercontent.com/hadolint/language-docker/7e4bceea394c83ee1fec90263db86fd0e312c48a/src/Language/Docker/Parser/From.hs | haskell | module Language.Docker.Parser.From
( parseFrom,
)
where
import qualified Data.Text as T
import Language.Docker.Parser.Prelude
import Language.Docker.Syntax
parseRegistry :: (?esc :: Char) => Parser Registry
parseRegistry = do
domain <- someUnless "a domain name" (== '.')
void $ char '.'
tld <- someUnless "a... | |
d0eeb0296444f90d9257ff01424968c08d00c4bd0b7c6c1b33ef96f6208a49b2 | mumuki/mulang | LogicSpec.hs | module LogicSpec (spec) where
import Test.Hspec
import Language.Mulang
import Language.Mulang.Parsers.Prolog
spec :: Spec
spec = do
describe "inspector" $ do
describe "declaresFact" $ do
it "is True when fact is declared" $ do
declaresFact (named "foo") (pl "foo(a).")... | null | https://raw.githubusercontent.com/mumuki/mulang/92684f687566b2adafb331eae5b5916e2d90709e/spec/LogicSpec.hs | haskell | module LogicSpec (spec) where
import Test.Hspec
import Language.Mulang
import Language.Mulang.Parsers.Prolog
spec :: Spec
spec = do
describe "inspector" $ do
describe "declaresFact" $ do
it "is True when fact is declared" $ do
declaresFact (named "foo") (pl "foo(a).")... | |
d8740c7a581df7f8474a93b5e54ac14f89b4627e90d75f3cc6270b46a2d6f2b5 | abtv/tech-radar | database.clj | (ns tech-radar.utils.database
(:require [clj-time.coerce :as tc]))
(defn to-underscores [s]
(.replace s \- \_))
(defn to-dashes [s]
(.replace s \_ \-))
(defn map->db-fn [{:keys [keyword-columns date-columns]
:or {keyword-columns #{}
date-columns #{}}}]
(fn [m... | null | https://raw.githubusercontent.com/abtv/tech-radar/167c1c66ff2cf7140fe1de247d67a7134b0b1748/src/clj/tech_radar/utils/database.clj | clojure | (ns tech-radar.utils.database
(:require [clj-time.coerce :as tc]))
(defn to-underscores [s]
(.replace s \- \_))
(defn to-dashes [s]
(.replace s \_ \-))
(defn map->db-fn [{:keys [keyword-columns date-columns]
:or {keyword-columns #{}
date-columns #{}}}]
(fn [m... | |
8c753955cdbe49ae337d69f007fc357006de25c7808cb880e577ac4b7f9ed807 | purescript/purescript | Types.hs | | Data types and functions for representing a simplified form of PureScript
-- code, intended for use in e.g. HTML documentation.
module Language.PureScript.Docs.RenderedCode.Types
( RenderedCodeElement(..)
, ContainingModule(..)
, asContainingModule
, maybeToContainingModule
, fromQualified
, Namespace(..)
,... | null | https://raw.githubusercontent.com/purescript/purescript/02bd6ae60bcd18cbfa892f268ef6359d84ed7c9b/src/Language/PureScript/Docs/RenderedCode/Types.hs | haskell | code, intended for use in e.g. HTML documentation.
|
Try the given parsers in sequence. If all fail, fail with the given message,
and include the JSON in the error.
|
easier to read, as the meaning is more explicit.
|
isomorphism.
|
A single element in a rendered code fragment. The intention is to support
... | | Data types and functions for representing a simplified form of PureScript
module Language.PureScript.Docs.RenderedCode.Types
( RenderedCodeElement(..)
, ContainingModule(..)
, asContainingModule
, maybeToContainingModule
, fromQualified
, Namespace(..)
, Link(..)
, FixityAlias
, RenderedCode
, outputWith... |
df99dc6d3540ce5cdb1bc0fe297b65e324959f1b3fc1f47776c9f7223bcf9430 | darkleaf/publicator | user_test.clj | (ns publicator.domain.aggregates.user-test
(:require
[publicator.domain.aggregates.user :as sut]
[publicator.domain.test.fakes :as fakes]
[publicator.utils.test.instrument :as instrument]
[publicator.domain.test.factories :as factories]
[publicator.domain.abstractions.aggregate :as aggregate]
[cloju... | null | https://raw.githubusercontent.com/darkleaf/publicator/e07eee93d8f3d9c07a15d574619d5ea59c00f87d/core/test/publicator/domain/aggregates/user_test.clj | clojure | (ns publicator.domain.aggregates.user-test
(:require
[publicator.domain.aggregates.user :as sut]
[publicator.domain.test.fakes :as fakes]
[publicator.utils.test.instrument :as instrument]
[publicator.domain.test.factories :as factories]
[publicator.domain.abstractions.aggregate :as aggregate]
[cloju... | |
a5b0d05a53b7aab5de9409c2cd5bcc81c47b570a5144d7a81639ae7ade497264 | charJe/funds | hash.lisp | (in-package :funds)
(defstruct dict
hash
test
tree)
(defun make-hash (&key (hash #'sxhash) (test #'eql))
"An empty hash that hashes occording to the given hash function,
which defaults to #'sxhash and and tests according to the given test
function, which defaults to #'eql."
(make-dict :hash hash :test test ... | null | https://raw.githubusercontent.com/charJe/funds/39d425818876b898c20780a678803df506df8424/src/hash.lisp | lisp | (in-package :funds)
(defstruct dict
hash
test
tree)
(defun make-hash (&key (hash #'sxhash) (test #'eql))
"An empty hash that hashes occording to the given hash function,
which defaults to #'sxhash and and tests according to the given test
function, which defaults to #'eql."
(make-dict :hash hash :test test ... | |
8e22aca1cc8d090dd4bb27d5b0697a6199d1289d83009a3315ae5714b51f02d1 | static-analysis-engineering/codehawk | jCHRaw2IF.ml | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Java Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Copy... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/98ced4d5e6d7989575092df232759afc2cb851f6/CodeHawk/CHJ/jchlib/jCHRaw2IF.ml | ocaml | jchlib
convert a list of attributes to an [attributes] structure.
it seems quite common
make_ms requires an argument is_static, which is not
known at this point for an enclosing method; we give it
a default argument false; currently the enclosing method
is not used; when it is used this ... | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Java Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Copy... |
ac8decac4739c94ee1d572e7495f41c383e880eca0d3ab5870ebe68dd661be34 | Ptival/language-ocaml | Test.hs | # LANGUAGE QuasiQuotes #
module Language.OCaml.Parser.ValIdent.Test
( testStrings,
)
where
import Data.String.Interpolate
import qualified Language.OCaml.Parser.Operator.Test as Operator
testStrings :: [String]
testStrings =
[]
++ ["foo"]
++ [[i|(#{op})|] | op <- Operator.testStrings]
| null | https://raw.githubusercontent.com/Ptival/language-ocaml/7b07fd3cc466bb2ad2cac4bfe3099505cb63a4f4/test/Language/OCaml/Parser/ValIdent/Test.hs | haskell | # LANGUAGE QuasiQuotes #
module Language.OCaml.Parser.ValIdent.Test
( testStrings,
)
where
import Data.String.Interpolate
import qualified Language.OCaml.Parser.Operator.Test as Operator
testStrings :: [String]
testStrings =
[]
++ ["foo"]
++ [[i|(#{op})|] | op <- Operator.testStrings]
| |
b003945790d3767f83b0a36cfe80cd817d5cde2c0b62157d238e70062d968668 | 0xYUANTI/huckleberry | huck_server.erl | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% @doc A Raft replica.
%%% This code is based on the TLA+ specification of the algorithm.
C.f . priv / proof.pdf
%%% @end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%_* Module declaration ========... | null | https://raw.githubusercontent.com/0xYUANTI/huckleberry/1df7d611b509a725140b048f444e820c044fb807/src/huck_server.erl | erlang |
@doc A Raft replica.
This code is based on the TLA+ specification of the algorithm.
@end
_* Module declaration ===============================================
_* Exports ==========================================================
Process API
Client API
gen_server callbacks
_* Includes ===========================... | C.f . priv / proof.pdf
-module(huck_server).
-behaviour(gen_server).
-export([ start_link/1
, stop/0
]).
-export([ read/1
, write/1
]).
-export([ code_change/3
, handle_call/3
, handle_cast/2
, handle_info/2
, init/1
, terminate/2
]).... |
ab6f781913f305588a7d3035fb5264b7930d44bf895c85cd80b583cd80bca499 | fpottier/pprint | PPrint.ml | (******************************************************************************)
(* *)
PPrint
(* *)... | null | https://raw.githubusercontent.com/fpottier/pprint/de9cc6364d33f63c7c279b12e99c8c5935f7ba08/src/PPrint.ml | ocaml | ****************************************************************************
Lice... | PPrint
,
Copyright 2007 - 2022 Inria . All rights reserved . This file is
distributed under the terms of the ... |
e9dd5284f742c5d542a36c445ac8c41c594d02e7ad58de666c3398bccd86d2ce | nikita-volkov/rebase | Safe.hs | module Rebase.Foreign.Safe
(
module Foreign.Safe
)
where
import Foreign.Safe
| null | https://raw.githubusercontent.com/nikita-volkov/rebase/7c77a0443e80bdffd4488a4239628177cac0761b/library/Rebase/Foreign/Safe.hs | haskell | module Rebase.Foreign.Safe
(
module Foreign.Safe
)
where
import Foreign.Safe
| |
4972f91a56a386be66a1e0de3195c6baac856e2df4d0f0c2b43f177a25789b50 | webnf/webnf | ring_dev.clj | (ns webnf.ring-dev
(:require [ring.util.response :refer [content-type response]]
[clojure.pprint :refer [pprint *print-right-margin*]]
[webnf.base :refer [pprint-str]]
[clojure.tools.logging :as log]))
(defn echo-handler
"A simple echo handler for ring requests. PPrints the requ... | null | https://raw.githubusercontent.com/webnf/webnf/6a2ccaa755e6e40528eb13a5c36bae16ba4947e7/handler/src/clj/webnf/ring_dev.clj | clojure | ")) | (ns webnf.ring-dev
(:require [ring.util.response :refer [content-type response]]
[clojure.pprint :refer [pprint *print-right-margin*]]
[webnf.base :refer [pprint-str]]
[clojure.tools.logging :as log]))
(defn echo-handler
"A simple echo handler for ring requests. PPrints the requ... |
67b00f1e2ed6ad9e892979143933c3db7ece800ffbdd96463e33f0408e869877 | jbclements/RSound | reverb.rkt | #lang typed/racket
(require racket/flonum)
(require/typed "network.rkt"
[#:struct network/s ([ins : Index]
[outs : Index]
[maker : (-> (Float -> Float))])])
(require/typed "common.rkt"
[default-sample-rate (Parameterof... | null | https://raw.githubusercontent.com/jbclements/RSound/c699db1ffae4cf0185c46bdc059d7879d40614ce/rsound/reverb.rkt | racket | this file provides the "reverb" network
this function produces a function from floats to floats.
the lpf midpoints
(define m2 0.0)
(define m3 0.0)
(define m4 0.0)
(define m5 0.0)
(define m6 0.0)
the tap counters
the main feedback buffers | #lang typed/racket
(require racket/flonum)
(require/typed "network.rkt"
[#:struct network/s ([ins : Index]
[outs : Index]
[maker : (-> (Float -> Float))])])
(require/typed "common.rkt"
[default-sample-rate (Parameterof... |
b524b8e6981c46a9ddb95413b5fb07b6bb7480c1e6160a409930a6ceebd4116f | mzp/coq-ruby | output.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/mzp/coq-ruby/99b9f87c4397f705d1210702416176b13f8769c1/tools/coqdoc/output.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
********************************************************************** | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
i $ I d : output.mli 12187 ... |
8b873c7af146a03f8d721e339ce2e30e3873ea247206917284d357b895c21a5c | jonsterling/dreamtt | Effect.ml | open Basis
open Syntax
module E =
struct
type local = {thy : Logic.thy; env : env}
let update_thy upd {thy; env} =
{thy = Logic.update upd thy; env}
let append_tm tm {thy; env} =
{thy; env = Env.append env @@ `Tm tm}
let set_env env {thy; _} =
{thy; env}
end
module L =
struct
module M = Reader... | null | https://raw.githubusercontent.com/jonsterling/dreamtt/aa30a57ca869e91a295e586773a892c6601b5ddb/core/Effect.ml | ocaml | open Basis
open Syntax
module E =
struct
type local = {thy : Logic.thy; env : env}
let update_thy upd {thy; env} =
{thy = Logic.update upd thy; env}
let append_tm tm {thy; env} =
{thy; env = Env.append env @@ `Tm tm}
let set_env env {thy; _} =
{thy; env}
end
module L =
struct
module M = Reader... | |
b287ef6d988427695f53806a099749ae11f1178286d2b6df45f99eeb7f8a4e80 | GaloisInc/what4 | PolyRoot.hs | |
Module : What4.Protocol . PolyRoot
Description : Representation for algebraic reals
Copyright : ( c ) Galois Inc , 2016 - 2020
License : :
Defines a numeric data - type where each number is represented as the root of a
polynomial over a single variable .
This currently only defines... | null | https://raw.githubusercontent.com/GaloisInc/what4/91200aa39565c156226cec6a9409a692e4022501/what4/src/What4/Protocol/PolyRoot.hs | haskell | # LANGUAGE DeriveTraversable #
| Create a polyomial from a map from powers to coefficient.
| Parse a positive monomial
| Parses a monomial and returns the coefficient and power
| Evaluate polynomial at a specific value.
Note that due to rounding, the result may not be exact when using
finite precision arithmetic... | |
Module : What4.Protocol . PolyRoot
Description : Representation for algebraic reals
Copyright : ( c ) Galois Inc , 2016 - 2020
License : :
Defines a numeric data - type where each number is represented as the root of a
polynomial over a single variable .
This currently only defines... |
d02dfe99da6249e14d8d742d56dfda79354186214c73f1981381dacadf5d3382 | ankushdas/Nomos | RastConfig.ml | (* Configuration for running rast files *)
module R = Arith
module A = Ast
module PP = Pprint
module F = RastFlags
module C = Core
module E = Exec
module EL = Elab
module I = Infer
module TC = Typecheck
(************************)
(* Command Line Options *)
(************************)
type option =
Work of stri... | null | https://raw.githubusercontent.com/ankushdas/Nomos/db678f3981e75a1b3310bb55f66009bb23430cb1/rast/RastConfig.ml | ocaml | Configuration for running rast files
**********************
Command Line Options
**********************
*******************************
Loading and Elaborating Files
*******************************
ignore #test pragma
internal lexer and parser state
let () = I.reset () in (* resets the... |
module R = Arith
module A = Ast
module PP = Pprint
module F = RastFlags
module C = Core
module E = Exec
module EL = Elab
module I = Infer
module TC = Typecheck
type option =
Work of string
| Syntax of string
| Verbose of int
| Invalid of string;;
let process_option ext op = match op with
Work(s) ->... |
9c7e76a26199ae0733b1bfdea0e4000bd5ce50b204ca25f0ca3cf5fe7a8d912d | marick/fp-oo | Y.clj | Exercise 1
(def recurser-core
(fn [stop-when ending-value combiner reducer]
(letfn [(recursive-function [something]
(if (stop-when something)
(ending-value something)
(combiner something
(recursive-function (reducer something... | null | https://raw.githubusercontent.com/marick/fp-oo/434937826d794d6fe02b3e9a62cf5b4fbc314412/solutions/Y.clj | clojure | Exercise 1
(def recurser-core
(fn [stop-when ending-value combiner reducer]
(letfn [(recursive-function [something]
(if (stop-when something)
(ending-value something)
(combiner something
(recursive-function (reducer something... | |
564d7edeb4f96739e45b0d167581b55aa2dc16f661bd4f122f35e45454a53167 | gerlion/secure-e-voting-with-coq | ElectionGuard_j.mli | Auto - generated from " ElectionGuard.atd "
[@@@ocaml.warning "-27-32-35-39"]
type pkproof = ElectionGuard_t.pkproof = {
commitment: string;
challenge: string;
response: string
}
type trustee_public_key = ElectionGuard_t.trustee_public_key = {
public_key: string;
proof: pkproof
}
type commitment = Electi... | null | https://raw.githubusercontent.com/gerlion/secure-e-voting-with-coq/c85f58f5759b960cc9d90a96fe7970e038523a9a/ElectionGuard/OCaml/ElectionGuard_j.mli | ocaml | * Output a JSON value of type {!trustee_public_key}.
* Input JSON data of type {!trustee_public_key}.
* Output a JSON value of type {!commitment}.
* Input JSON data of type {!commitment}.
* Output a JSON value of type {!proof}.
* Input JSON data of type {!proof}.
* Output a JSON value of type {!ciphertext}.
* In... | Auto - generated from " ElectionGuard.atd "
[@@@ocaml.warning "-27-32-35-39"]
type pkproof = ElectionGuard_t.pkproof = {
commitment: string;
challenge: string;
response: string
}
type trustee_public_key = ElectionGuard_t.trustee_public_key = {
public_key: string;
proof: pkproof
}
type commitment = Electi... |
67de1cf0a561d5d753f67b699a0273e441543c0ebf1c290849a75eaa31f893c1 | elaforge/karya | LTScore.hs | Copyright 2018
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or -3.0.txt
-- | Functions to deal with text score, as stored in 'UiConfig.config_tscore'.
module Cmd.Repl.LTScore where
import qualified App.ReplProtocol as ReplProtocol
import qualified Cmd.Cmd as ... | null | https://raw.githubusercontent.com/elaforge/karya/471a2131f5a68b3b10b1a138e6f9ed1282980a18/Cmd/Repl/LTScore.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt
| Functions to deal with text score, as stored in 'UiConfig.config_tscore'.
| Edit both ky and tscore together. | Copyright 2018
module Cmd.Repl.LTScore where
import qualified App.ReplProtocol as ReplProtocol
import qualified Cmd.Cmd as Cmd
import qualified Cmd.Create as Create
import qualified Cmd.Repl.LState as LState
import qualified Derive.TScore.TScore as TScore
import qualified Ui.Ui as Ui
import qualified Ui.UiConfig ... |
bed7b301f423e04d7911f4546761cb7982944ba1671c06e78199b0636359abdc | kappelmann/engaging-large-scale-functional-programming | Exercise03.hs | module Exercise03 where
isPrime :: Integer -> Bool
isPrime n | n < 2 = False
isPrime n = go 2
where go x
| x * x > n = True
| n `mod` x == 0 = False
| otherwise = x `seq` go (x + 1)
primeMayor :: Integer -> Integer
primeMayor 2 = 1
primeMayor n
| even n = 2
| isPrime n = 1
| isPr... | null | https://raw.githubusercontent.com/kappelmann/engaging-large-scale-functional-programming/8ed2c056fbd611f1531230648497cb5436d489e4/resources/contest/example_data/03/uploads/maol/Exercise03.hs | haskell | module Exercise03 where
isPrime :: Integer -> Bool
isPrime n | n < 2 = False
isPrime n = go 2
where go x
| x * x > n = True
| n `mod` x == 0 = False
| otherwise = x `seq` go (x + 1)
primeMayor :: Integer -> Integer
primeMayor 2 = 1
primeMayor n
| even n = 2
| isPrime n = 1
| isPr... | |
72142c7f6fb4f15ebe9e6c22bd4390c5956b0e245687e88e371aad7376dd59a1 | wireapp/wire-server | Run.hs | # LANGUAGE RecordWildCards #
-- This file is part of the Wire Server implementation.
--
Copyright ( C ) 2022 Wire Swiss GmbH < >
--
-- This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , e... | null | https://raw.githubusercontent.com/wireapp/wire-server/f72b09756102a5c66169cca0343aa7b7e6e54491/services/spar/migrate-data/src/Spar/DataMigration/Run.hs | haskell | This file is part of the Wire Server implementation.
This program is free software: you can redistribute it and/or modify it under
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTI... | # LANGUAGE RecordWildCards #
Copyright ( C ) 2022 Wire Swiss GmbH < >
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License , or ( at your option ) any
You should have received a copy of the GNU Affero General Public License along
mo... |
44ce288392a8d2a00451326acc114912344d93a5cf6c69f8c7140a42936c6fc1 | camlp4/camlp4 | ex_str_test.ml | (****************************************************************************)
(* *)
(* OCaml *)
(* *)
(* ... | null | https://raw.githubusercontent.com/camlp4/camlp4/9b3314ea63288decb857239bd94f0c3342136844/camlp4/examples/ex_str_test.ml | ocaml | **************************************************************************
OCaml
... | Copyright 2007 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 the special
function <<foo>> -> <<bar>>
|
466bec1be20e2cbac0cb5934300a29cb69ce3151dd701a4a4eea1f3f15c6b07d | miniway/kafka-clj | serializable_test.clj | (ns kafka.serializable-test
(:use :reload-all (kafka types serializable)
clojure.test))
;(deftest test-pack-unpack
; (is (= "test" (String. (.bytes (pack "test")) "UTF8")))
( is (= 123 ( Long . ( unpack ( pack 123 ) ) ) ) )
; (is (= true (unpack (pack true))))
( is (= [ 1 2 3 ] ( unpack ( pack [ 1 2... | null | https://raw.githubusercontent.com/miniway/kafka-clj/6cbeb631e87a98ba1b737823ff0493e1ccca6847/test/kafka/serializable_test.clj | clojure | (deftest test-pack-unpack
(is (= "test" (String. (.bytes (pack "test")) "UTF8")))
(is (= true (unpack (pack true))))
(is (= '(+ 1 2 3) (unpack (pack '(+ 1 2 3)))))
(let [now (java.util.Date.)]
(is (= now (unpack (pack now)))))
) | (ns kafka.serializable-test
(:use :reload-all (kafka types serializable)
clojure.test))
( is (= 123 ( Long . ( unpack ( pack 123 ) ) ) ) )
( is (= [ 1 2 3 ] ( unpack ( pack [ 1 2 3 ] ) ) ) )
( is (= { : a 1 } ( unpack ( pack { : a 1 } ) ) ) )
|
dc909fc6011d6b99165f35668f1d96b10663856308e05194cbf3e410ee7c272e | lambda-pi-plus/lambda-pi-plus | Internals.hs | {-# LANGUAGE QuasiQuotes #-}
# LANGUAGE TemplateHaskell #
# LANGUAGE TupleSections #
module Language.LambdaPiPlus.Internals
where
import Common
import qualified ConstraintBased as CB
import Main
import qualified PatternUnify.Tm as Tm
import Text.Parsec
import Text.Parsec.Pos (SourcePos)
import Control.Monad... | null | https://raw.githubusercontent.com/lambda-pi-plus/lambda-pi-plus/78eba7ebb7b2ed94f7cb06f0d1aca4d07eb3626f/src/Language/LambdaPiPlus/Internals.hs | haskell | # LANGUAGE QuasiQuotes #
checkEval :: String -> i -> IO (State v inf) | # LANGUAGE TemplateHaskell #
# LANGUAGE TupleSections #
module Language.LambdaPiPlus.Internals
where
import Common
import qualified ConstraintBased as CB
import Main
import qualified PatternUnify.Tm as Tm
import Text.Parsec
import Text.Parsec.Pos (SourcePos)
import Control.Monad.Writer
import qualified Unbound... |
018ece6344c80f203b531860c7ad40564826cab22f9609fde447dab42ec0a9e2 | mransan/ocaml-protoc | pb_codegen_default.mli | (** Code generator for the [default] function *)
include Pb_codegen_sig.S
val gen_record_mutable :
gen_file_suffix:string ->
module_prefix:string ->
Pb_codegen_ocaml_type.record ->
Pb_codegen_formatting.scope ->
unit
| null | https://raw.githubusercontent.com/mransan/ocaml-protoc/e43b509b9c4a06e419edba92a0d3f8e26b0a89ba/src/compilerlib/pb_codegen_default.mli | ocaml | * Code generator for the [default] function |
include Pb_codegen_sig.S
val gen_record_mutable :
gen_file_suffix:string ->
module_prefix:string ->
Pb_codegen_ocaml_type.record ->
Pb_codegen_formatting.scope ->
unit
|
16a23c76a1a9cca019d0ea22a6e449b2bc7f339e7b1c5b788e062cbd681cfbb7 | rmloveland/scheme48-0.53 | values.scm | Copyright ( c ) 1994 by . See file COPYING .
(define (sender)
(values 1 2 3 4))
(define (receiver a b c d)
(+ a (- b (* c d))))
(define (test)
(call-with-values sender receiver))
| null | https://raw.githubusercontent.com/rmloveland/scheme48-0.53/1ae4531fac7150bd2af42d124da9b50dd1b89ec1/ps-compiler/prescheme/test/values.scm | scheme | Copyright ( c ) 1994 by . See file COPYING .
(define (sender)
(values 1 2 3 4))
(define (receiver a b c d)
(+ a (- b (* c d))))
(define (test)
(call-with-values sender receiver))
| |
26313653eaa1d6d958ea3b3574182124945c689a98def46e880a2bc13e0de0e8 | chenyukang/eopl | tests.scm | (module tests mzscheme
(provide test-list)
;;;;;;;;;;;;;;;; tests ;;;;;;;;;;;;;;;;
(define test-list
'(
;; simple arithmetic
(positive-const "11" 11)
(negative-const "-33" -33)
(simple-arith-1 "-(44,33)" 11)
;; nested arithmetic
(nested-arith-left ... | null | https://raw.githubusercontent.com/chenyukang/eopl/0406ff23b993bfe020294fa70d2597b1ce4f9b78/base/chapter4/call-by-reference/tests.scm | scheme | tests ;;;;;;;;;;;;;;;;
simple arithmetic
nested arithmetic
simple variables
simple unbound variables
simple conditionals
test dynamic typechecking
make sure that the test and both arms get evaluated
properly.
and make sure the other arm doesn't get evaluated.
simple let
check nested let and shad... | (module tests mzscheme
(provide test-list)
(define test-list
'(
(positive-const "11" 11)
(negative-const "-33" -33)
(simple-arith-1 "-(44,33)" 11)
(nested-arith-left "-(-(44,33),22)" -11)
(nested-arith-right "-(55, -(22,11))" 44)
(test-var-1 "x" 1... |
395fbab036d2182b32096e791324d55a806d2e331345335ecff6e3c10db5081f | arttuka/reagent-material-ui | arrow_outward_outlined.cljs | (ns reagent-mui.icons.arrow-outward-outlined
"Imports @mui/icons-material/ArrowOutwardOutlined as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def arrow-outward... | null | https://raw.githubusercontent.com/arttuka/reagent-material-ui/14103a696c41c0eb67fc07fc67cd8799efd88cb9/src/icons/reagent_mui/icons/arrow_outward_outlined.cljs | clojure | (ns reagent-mui.icons.arrow-outward-outlined
"Imports @mui/icons-material/ArrowOutwardOutlined as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def arrow-outward... | |
98228448b075b14cd2fb3822319847264bb35538f6dbd167654633f31f83bf96 | yallop/ocaml-ctypes | test_coercions.ml |
* Copyright ( c ) 2013 .
*
* This file is distributed under the terms of the MIT License .
* See the file LICENSE for details .
* Copyright (c) 2013 Jeremy Yallop.
*
* This file is distributed under the terms of the MIT License.
* See the file LICENSE for details.
*)
open OUnit2
open Ctypes
(* ... | null | https://raw.githubusercontent.com/yallop/ocaml-ctypes/52ff621f47dbc1ee5a90c30af0ae0474549946b4/tests/test-coercions/test_coercions.ml | ocaml |
Check coercions between pointers.
Check that pointer coercions are value-preserving.
Check that coercions between a pointer to a union and a pointer to
a member succeed.
Check coercions between views.
Check coercions between functions.
Check that identity coercions are cost-free.
... |
* Copyright ( c ) 2013 .
*
* This file is distributed under the terms of the MIT License .
* See the file LICENSE for details .
* Copyright (c) 2013 Jeremy Yallop.
*
* This file is distributed under the terms of the MIT License.
* See the file LICENSE for details.
*)
open OUnit2
open Ctypes
let... |
cd1c66c20dc7d81fa48f56e9a67754f33ed40028cda6d8b252abfbe39e73b3e2 | ocaml-ppx/cinaps | non_staged_error.ml | let error_message =
"the direct mode of cinaps is no longer supported. Please use the \"cinaps\" stanza in \
your dune file instead."
;;
| null | https://raw.githubusercontent.com/ocaml-ppx/cinaps/2791bce694bfea6ab077f13fc2987fb56fa5006f/src/non_staged_error.ml | ocaml | let error_message =
"the direct mode of cinaps is no longer supported. Please use the \"cinaps\" stanza in \
your dune file instead."
;;
| |
7ee8aaec95be8557813e53bcf5aee0e8d6eb853e007728ac0f05661338850a72 | lisp-mirror/clpm | vcs.lisp | Sources for projects taken from source control . A VCS source requires a
;;;; repo to be checked out before much can be done with it.
;;;;
This software is part of CLPM . See README.org for more information . See
;;;; LICENSE for license information.
;; * define package
(uiop:define-package #:clpm/sources/vcs
... | null | https://raw.githubusercontent.com/lisp-mirror/clpm/174b7db5e548518aff668cdd1f4d1a7b863becfb/clpm/sources/vcs.lisp | lisp | repo to be checked out before much can be done with it.
LICENSE for license information.
* define package
* sources
* projects
** Overrides
** Projects
* releases
Error unless the target branch name matches the actual branch name.
Warn if the desired commit is not present in the repo.
* system files
Sigh. ... | Sources for projects taken from source control . A VCS source requires a
This software is part of CLPM . See README.org for more information . See
(uiop:define-package #:clpm/sources/vcs
(:use #:cl
#:alexandria
#:anaphora
#:clpm/archives
#:clpm/groveler
#:clpm... |
6c17577d3a1ad8cf1fbdd5294d8e65c7f77b8c06e31a9ff70e439b8bc6e01685 | letmaik/monadiccp | If.hs | # LANGUAGE FlexibleContexts #
module Control.Search.Combinator.If (if') where
import Control.Search.Language
import Control.Search.GeneratorInfo
import Control.Search.MemoReader
import Control.Search.Generator
import Control.Search.Stat
import Control.Monatron.Monatron hiding (Abort, L, state, cont)
import Control.M... | null | https://raw.githubusercontent.com/letmaik/monadiccp/fe4498e46a7b9d9e387fd5e4ed5d0749a89d0188/src/Control/Search/Combinator/If.hs | haskell | , continue = \_ -> return true | # LANGUAGE FlexibleContexts #
module Control.Search.Combinator.If (if') where
import Control.Search.Language
import Control.Search.GeneratorInfo
import Control.Search.MemoReader
import Control.Search.Generator
import Control.Search.Stat
import Control.Monatron.Monatron hiding (Abort, L, state, cont)
import Control.M... |
d1f0e272744e05b98193ab452a2ec6e55fa5feaa07b3963d14c4fe57fb58edb3 | bitnomial/bitcoind-rpc | Misc.hs | {-# LANGUAGE OverloadedStrings #-}
module Bitcoin.Core.Test.Misc (
miscRPC,
) where
import Control.Monad (replicateM)
import Data.Text (Text)
import Data.Word (Word64)
import Haskoin.Address (Address (..), addrToText, pubKeyAddr)
import Haskoin.Block (Block (..), BlockHash)
import Haskoin.Constants (btcTest)
impo... | null | https://raw.githubusercontent.com/bitnomial/bitcoind-rpc/02ee92a6365955a427d18ae9be8e7771b0b86a9e/bitcoind-regtest/test/Bitcoin/Core/Test/Misc.hs | haskell | # LANGUAGE OverloadedStrings # |
module Bitcoin.Core.Test.Misc (
miscRPC,
) where
import Control.Monad (replicateM)
import Data.Text (Text)
import Data.Word (Word64)
import Haskoin.Address (Address (..), addrToText, pubKeyAddr)
import Haskoin.Block (Block (..), BlockHash)
import Haskoin.Constants (btcTest)
import Haskoin.Crypto (SecKey)
import H... |
3ea24621736017e643e3edd9a19af009dc66b9eba7b54119da6ec499bb72f196 | ocamllabs/ocaml-modular-implicits | test_nats.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet Crista... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/testsuite/tests/lib-num/test_nats.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 Q Public License version 1.0 .
open Test;;
open Nat;;
Can compare nats less t... |
2c10037d0b268818b5a6ee3909d3feb2151b8048c3c5a411ee0cada43b87d379 | avsm/ocaml-docker-scripts | dockerfile-opam.ml | #!/usr/bin/env ocamlscript
Ocaml.packs := ["dockerfile.opam"; "dockerfile.opam-cmdliner"]
--
Generate OPAM base images with particular revisions of OCaml and OPAM .
ISC License is at the end of the file .
ISC License is at the end of the file. *)
(* Generate Markdown list of tags for the README master *)
let... | null | https://raw.githubusercontent.com/avsm/ocaml-docker-scripts/86fd07285c33fdbe70d3201f7681cb187a115fca/dockerfile-opam.ml | ocaml | Generate Markdown list of tags for the README master | #!/usr/bin/env ocamlscript
Ocaml.packs := ["dockerfile.opam"; "dockerfile.opam-cmdliner"]
--
Generate OPAM base images with particular revisions of OCaml and OPAM .
ISC License is at the end of the file .
ISC License is at the end of the file. *)
let master_markdown_index =
let open Dockerfile_distro in
... |
40f83fa909891ff7b922dea125f1156ac7a30569818220d867a836086b2d0426 | jackfirth/lens | id-append.rkt | #lang racket/base
(provide id-append)
(require racket/list
racket/syntax
syntax/srcloc)
;; orig : Syntax -> Syntax
(define (orig stx)
(syntax-property stx 'original-for-check-syntax #t))
Sub - Range - Binder - Prop = ( ( Vector I d Nat Nat Real Real I d Nat Nat Real Real ) )
Binder - Proc =... | null | https://raw.githubusercontent.com/jackfirth/lens/733db7744921409b69ddc78ae5b23ffaa6b91e37/lens-common/lens/private/util/id-append.rkt | racket | orig : Syntax -> Syntax
make-binder-proc : Id Nat -> Binder-Proc
empty-id : Syntax -> Id
id-append : #:context Syntax Identifier ... -> (values Identifier Sub-Range-Binder-Prop)
a wrapper around id-append* that keeps track of identifiers that
are themselves appended from other identifiers
id-append* : #:context ... | #lang racket/base
(provide id-append)
(require racket/list
racket/syntax
syntax/srcloc)
(define (orig stx)
(syntax-property stx 'original-for-check-syntax #t))
Sub - Range - Binder - Prop = ( ( Vector I d Nat Nat Real Real I d Nat Nat Real Real ) )
Binder - Proc = I d - > Sub - Range - Bind... |
f8f15321e8f8a958d2e8fa4114cd5866cc8d4467de21ced399f95b32b7a65106 | tweag/ormolu | multiline2.hs | module Foo (
foo, bar, baz) where
| null | https://raw.githubusercontent.com/tweag/ormolu/34bdf62429768f24b70d0f8ba7730fc4d8ae73ba/data/examples/module-header/multiline2.hs | haskell | module Foo (
foo, bar, baz) where
| |
28fdfc97ed5d58a12f941549faf17e5b5826d0be90da0253ea619716e0717cee | NorfairKing/the-notes | Difference.hs | module Sets.Algebra.Difference where
import Notes
import Logic.PropositionalLogic.Macro
import Sets.Algebra.Difference.Terms
setDifference :: Note
setDifference = subsection "Difference" $ do
differenceDefinition
intersectionAndDifferenceDisjunct
symmetricSetDifferencesDis... | null | https://raw.githubusercontent.com/NorfairKing/the-notes/ff9551b05ec3432d21dd56d43536251bf337be04/src/Sets/Algebra/Difference.hs | haskell | module Sets.Algebra.Difference where
import Notes
import Logic.PropositionalLogic.Macro
import Sets.Algebra.Difference.Terms
setDifference :: Note
setDifference = subsection "Difference" $ do
differenceDefinition
intersectionAndDifferenceDisjunct
symmetricSetDifferencesDis... | |
2a60d6b5038bff6d2ee3d467bb7b7d886ccd350dc8eab7a6e7ef535a3af15259 | lread/test-doc-blocks | example.cljc | (ns example
"Cljdoc supports CommonMark in docstrings.
Test doc block will scan docstrings for CommonMark Clojure code blocks and generate tests for them.
Test doc blocks currently ONLY looks at doc strings, so if your code block needs specific requires,
you'll have to include them in, at least, your fir... | null | https://raw.githubusercontent.com/lread/test-doc-blocks/f81643a5114d0ef9fda94e5da5591c58cae00692/doc/example.cljc | clojure | => \"who,who\" | (ns example
"Cljdoc supports CommonMark in docstrings.
Test doc block will scan docstrings for CommonMark Clojure code blocks and generate tests for them.
Test doc blocks currently ONLY looks at doc strings, so if your code block needs specific requires,
you'll have to include them in, at least, your fir... |
20718a84d932742cb6479e6d5749d2ba57c5699857d260f71607f51e0d7c2ce1 | nushio3/learn-haskell | Main.hs | module Main where
import qualified Data.Map as M
-- guzaiがnabeに入っていたらその具材の個数を1減らす、
guzaiの個数がゼロになったらその項目をMapから消す 、
-- ように、関数eatを追記してください。
eat :: String -> M.Map String Int -> M.Map String Int
eat guzai nabe = nabe
party :: M.Map String Int -> IO ()
party nabe = do
putStrLn $ "Nabe: " ++ show nabe
order <- ge... | null | https://raw.githubusercontent.com/nushio3/learn-haskell/eda0fd0b33e9c4b7552afd24c6a25a105cca5f94/exercise-7-nabe/src/Main.hs | haskell | guzaiがnabeに入っていたらその具材の個数を1減らす、
ように、関数eatを追記してください。
ここで、鍋が空(null)かどうかを判定してください。 | module Main where
import qualified Data.Map as M
guzaiの個数がゼロになったらその項目をMapから消す 、
eat :: String -> M.Map String Int -> M.Map String Int
eat guzai nabe = nabe
party :: M.Map String Int -> IO ()
party nabe = do
putStrLn $ "Nabe: " ++ show nabe
order <- getLine
let newNabe = eat order nabe
then putStrLn "T... |
4fe8a61018cfab942b93707d0c899005de73dea232617a03a9cd262a56208696 | mbutterick/typesetting | core.rkt | #lang racket/base
(require txexpr/base racket/string racket/list)
(provide hyphenate unhyphenate word->hyphenation-points exception-word->word+pattern string->hashpair)
(module+ test
(require rackunit))
;; module default values
(define default-min-length 5)
(define default-min-left-length 2)
(define default-min-ri... | null | https://raw.githubusercontent.com/mbutterick/typesetting/8eedb97bb64cb2ff0cd9646eb1b0e46b67f1af44/hyphenate/hyphenate/private/core.rkt | racket | module default values
an exception word indicates its breakpoints with added hyphens
0 no hyphenation
use list here so we can `apply` in `add-exception-word`
`hash-set!` not `hash-ref!`, because we want an exception to override an existing value
using unicode-aware regexps to allow unicode hyphenation patterns
a... | #lang racket/base
(require txexpr/base racket/string racket/list)
(provide hyphenate unhyphenate word->hyphenation-points exception-word->word+pattern string->hashpair)
(module+ test
(require rackunit))
(define default-min-length 5)
(define default-min-left-length 2)
(define default-min-right-length 2)
(define def... |
97943a9e5d84af7396785e482b991cebd7095abc0d091bd6a3b1e75e045bea42 | frenetic-lang/ocaml-topology | myocamlbuild.ml | OASIS_START
DO NOT EDIT ( digest : 2b5a8e0179c60ac087ac61f4ea3a67d4 )
module OASISGettext = struct
# 22 " src / oasis / OASISGettext.ml "
let ns_ str =
str
let s_ str =
str
let f_ (str: ('a, 'b, 'c, 'd) format4) =
str
let fn_ fmt1 fmt2 n =
if n = 1 then
fmt1^^""
else
... | null | https://raw.githubusercontent.com/frenetic-lang/ocaml-topology/a13ed36faaf216962fabd24d3402f91f5fec781d/myocamlbuild.ml | ocaml | these functions are not really officially exported
ocamlfind command
This lists all supported packages.
Mock to list available syntaxes.
By using Before_options one let command line options have an higher
* priority on the contrary using After_options will guarantee to have
* the higher p... | OASIS_START
DO NOT EDIT ( digest : 2b5a8e0179c60ac087ac61f4ea3a67d4 )
module OASISGettext = struct
# 22 " src / oasis / OASISGettext.ml "
let ns_ str =
str
let s_ str =
str
let f_ (str: ('a, 'b, 'c, 'd) format4) =
str
let fn_ fmt1 fmt2 n =
if n = 1 then
fmt1^^""
else
... |
505845b3dfd45b246ae5edfda0a5dcff826003090e7cdc4bb498fca573462e79 | entangled/entangled | TextUtil.hs | -- ~\~ language=Haskell filename=src/TextUtil.hs
-- ~\~ begin <<lit/a6-text-utils.md|src/TextUtil.hs>>[init]
# LANGUAGE NoImplicitPrelude #
module TextUtil where
import RIO
import qualified RIO.Text as T
import Data.Char (isSpace)
-- ~\~ begin <<lit/a6-text-utils.md|indent>>[init]
indent :: Text -> Text -> Text
inde... | null | https://raw.githubusercontent.com/entangled/entangled/bd3e996959f3beddba6c0727e9a11d1190e8cb7b/src/TextUtil.hs | haskell | ~\~ language=Haskell filename=src/TextUtil.hs
~\~ begin <<lit/a6-text-utils.md|src/TextUtil.hs>>[init]
~\~ begin <<lit/a6-text-utils.md|indent>>[init]
~\~ end
~\~ begin <<lit/a6-text-utils.md|unindent>>[init]
~\~ end
~\~ begin <<lit/a6-text-utils.md|unlines>>[init]
~\~ end
~\~ begin <<lit/a6-text-utils.md|mayb... | # LANGUAGE NoImplicitPrelude #
module TextUtil where
import RIO
import qualified RIO.Text as T
import Data.Char (isSpace)
indent :: Text -> Text -> Text
indent pre text
= unlines' $ map indentLine $ lines' text
where indentLine line
| line == "" = line
| otherwise = pre <> line
unind... |
7b895057db55a6d841dcca4908dec39755e015cef945752b74b09287e6a19d9d | Jannis/om-next-kanban-demo | sortable_list.cljs | (ns cards.sortable-list
(:require [clojure.string :as str]
[devcards.core :as dc :refer-macros [defcard]]
[om.dom :as dom]
[kanban.components.card :as kanban-card]
[kanban.components.sortable-list :refer [sortable-list]]))
(defcard
"# Sortable List
This is a gener... | null | https://raw.githubusercontent.com/Jannis/om-next-kanban-demo/84719bfb161d82f1d4405e263f258730277c7783/src/cards/sortable_list.cljs | clojure | it receives an ordered sequence of items in the | (ns cards.sortable-list
(:require [clojure.string :as str]
[devcards.core :as dc :refer-macros [defcard]]
[om.dom :as dom]
[kanban.components.card :as kanban-card]
[kanban.components.sortable-list :refer [sortable-list]]))
(defcard
"# Sortable List
This is a gener... |
45d90259b7c5677f7c1ff08d11053d6df34c8ccc4854f64e848e6aadb98a88e3 | aeternity/aesophia | aeso_abi_tests.erl | -module(aeso_abi_tests).
-include_lib("eunit/include/eunit.hrl").
-compile([export_all, nowarn_export_all]).
-define(SANDBOX(Code), sandbox(fun() -> Code end)).
-define(DUMMY_HASH_WORD, 16#123).
-define(DUMMY_HASH_LIT, "#0000000000000000000000000000000000000000000000000000000000000123").
sandbox(Code) ->
Parent ... | null | https://raw.githubusercontent.com/aeternity/aesophia/a894876f56a818f6237259a7c48cbe6f4a4c01f8/test/aeso_abi_tests.erl | erlang | -module(aeso_abi_tests).
-include_lib("eunit/include/eunit.hrl").
-compile([export_all, nowarn_export_all]).
-define(SANDBOX(Code), sandbox(fun() -> Code end)).
-define(DUMMY_HASH_WORD, 16#123).
-define(DUMMY_HASH_LIT, "#0000000000000000000000000000000000000000000000000000000000000123").
sandbox(Code) ->
Parent ... | |
47ca85a522d77473728f619157d9474a6dede6a3a7767c729c8bd29e9b5a8490 | VisionsGlobalEmpowerment/webchange | icon_page_image_only.cljs | (ns webchange.ui.components.icon.layout.icon-page-image-only)
(def data
[:svg {:xmlns ""
:width "104" :height "142" :viewBox "0 0 104 142"
:fill "none" :stroke "#DCE3F5" :stroke-width "2"
:class-name "stroke-colored"}
[:g
[:rect {:x "1" :y "1" :width "102" :height "140" :rx "5... | null | https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/0df52dd08d54f14d4ec5d2717f48031849a7ee16/src/cljs/webchange/ui/components/icon/layout/icon_page_image_only.cljs | clojure | (ns webchange.ui.components.icon.layout.icon-page-image-only)
(def data
[:svg {:xmlns ""
:width "104" :height "142" :viewBox "0 0 104 142"
:fill "none" :stroke "#DCE3F5" :stroke-width "2"
:class-name "stroke-colored"}
[:g
[:rect {:x "1" :y "1" :width "102" :height "140" :rx "5... | |
7961f88ec8adbd9041f53aeb6dd5e327002f6a2dc39e97c9174facf5fa5be03d | lisper99/cltcl | system.lisp | Copyright ( c ) 2008 - 2014
;;
;; Permission is hereby granted, free of charge, to any person
;; obtaining a copy of this software and associated documentation
files ( the " Software " ) , to deal in the Software without
;; restriction, including without limitation the rights to use, copy,
;; modify, merg... | null | https://raw.githubusercontent.com/lisper99/cltcl/6edcec24689f04a10d6df4d402548c254b76eac5/system.lisp | lisp |
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
furnished to do so, subject to the following conditi... | Copyright ( c ) 2008 - 2014
files ( the " Software " ) , to deal in the Software without
of the Software , and to permit persons to whom the Software is
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ,
BE LIABLE ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.