_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 |
|---|---|---|---|---|---|---|---|---|
7f1d49ec10ac309e58eebf60537c42e776d5453510d7518f199b0b9d65935354 | squirrel-prover/squirrel-prover | checks.ml | (** Register and execute unit testing suites *)
let suites = ref []
let add_suite name lst = suites := (name,lst) :: !suites
let run () =
Alcotest.run ~argv:Sys.argv "Squirrel" (List.rev !suites)
| null | https://raw.githubusercontent.com/squirrel-prover/squirrel-prover/cd0dd445d0e5d739f059730d9f54b7d2c21dc694/src/checks.ml | ocaml | * Register and execute unit testing suites |
let suites = ref []
let add_suite name lst = suites := (name,lst) :: !suites
let run () =
Alcotest.run ~argv:Sys.argv "Squirrel" (List.rev !suites)
|
1167aec75c7bcc8098b29c42fed68c67c9855ab389fd0384441b6f858255a1d8 | scicloj/clj-djl | model_zoo.clj | (ns clj-djl.model-zoo
(:import [ai.djl.basicmodelzoo.basic Mlp]))
(defn mlp [input output hidden]
(Mlp. input output hidden))
| null | https://raw.githubusercontent.com/scicloj/clj-djl/f089b10a22c869c0e643d456dc9bbad8233bd6ac/src/clj_djl/model_zoo.clj | clojure | (ns clj-djl.model-zoo
(:import [ai.djl.basicmodelzoo.basic Mlp]))
(defn mlp [input output hidden]
(Mlp. input output hidden))
| |
7da652f25c1f9bb622cd4fa0c550aad62378b80c6eb86805130c092963964350 | shterrett/haskell-road | Hierarchy.hs | module Book.Hierarchy where
import Book.STAL(display)
import Book.SetEq
data S = Void deriving (Eq,Show)
empty :: Set S
empty = Set []
v0 = empty
v1 = powerSet v0
v2 = powerSet v1
v3 = powerSet v2
v4 = powerSet v3
v5 = powerSet v4
| null | https://raw.githubusercontent.com/shterrett/haskell-road/4af8253fc4475e5689b0ce59da468a3a6c92872e/src/Book/Hierarchy.hs | haskell | module Book.Hierarchy where
import Book.STAL(display)
import Book.SetEq
data S = Void deriving (Eq,Show)
empty :: Set S
empty = Set []
v0 = empty
v1 = powerSet v0
v2 = powerSet v1
v3 = powerSet v2
v4 = powerSet v3
v5 = powerSet v4
| |
9508b9c059c1a8a6184285f89ad51691715cae282f59e80c4109425790d798dc | into-docker/unixsocket-http | core.clj | (ns unixsocket-http.core
(:require [unixsocket-http.client :as client]
[unixsocket-http.data :as data]
[clojure.tools.logging :as log])
(:refer-clojure :exclude [get]))
# # Client
(defn client
"Create a new HTTP client that utilises the given TCP or UNIX domain socket to
perform H... | null | https://raw.githubusercontent.com/into-docker/unixsocket-http/2f40386664744e32394c48641fe1c5adbc121875/src/unixsocket_http/core.clj | clojure | by
this might
## I/O
streams and sockets will not be closed automatically! | (ns unixsocket-http.core
(:require [unixsocket-http.client :as client]
[unixsocket-http.data :as data]
[clojure.tools.logging :as log])
(:refer-clojure :exclude [get]))
# # Client
(defn client
"Create a new HTTP client that utilises the given TCP or UNIX domain socket to
perform H... |
e9893de5996f049bb7f70f1bb240ea42660839f63ae148719709806b6f844a29 | aantron/luv | hello_world.ml | let () =
print_endline "Hello, world!";
ignore (Luv.Loop.run () : bool)
| null | https://raw.githubusercontent.com/aantron/luv/4b49d3edad2179c76d685500edf1b44f61ec4be8/example/hello_world.ml | ocaml | let () =
print_endline "Hello, world!";
ignore (Luv.Loop.run () : bool)
| |
7fbbf17cfd56dbfd4cdcd9bbf994b04539a50e9af70ffc460c98bc104b762704 | tlaplus/tlapm | e_anon.mli |
* expr / anon.mli --- expressions ( anonymization )
*
*
* Copyright ( C ) 2008 - 2010 INRIA and Microsoft Corporation
* expr/anon.mli --- expressions (anonymization)
*
*
* Copyright (C) 2008-2010 INRIA and Microsoft Corporation
*)
open E_t
val hyp_is_named: string -> hyp -> bool
class anon: [s... | null | https://raw.githubusercontent.com/tlaplus/tlapm/158386319f5b6cd299f95385a216ade2b85c9f72/src/expr/e_anon.mli | ocaml |
* expr / anon.mli --- expressions ( anonymization )
*
*
* Copyright ( C ) 2008 - 2010 INRIA and Microsoft Corporation
* expr/anon.mli --- expressions (anonymization)
*
*
* Copyright (C) 2008-2010 INRIA and Microsoft Corporation
*)
open E_t
val hyp_is_named: string -> hyp -> bool
class anon: [s... | |
c22880d180578c42406e3be269c3f854da613f3778e75c62499d2da8867890af | arcfide/oleg | modif.scm | A tool for making functional - style modifications to SXML documents
;
; This software is in Public Domain.
IT IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND .
;
; Please send bug reports and comments to:
;
The basics of modification language design was inspired by
and his data m... | null | https://raw.githubusercontent.com/arcfide/oleg/c6826870436925fd4c873c01d7fcc24a7a7f95dc/sxml-tools/modif.scm | scheme |
This software is in Public Domain.
Please send bug reports and comments to:
/~lehti/
However, with functional techniques we can do this better...
==========================================================================
Modification core
Displays an error to stderr and returns #f
res-lst1 - contai... | A tool for making functional - style modifications to SXML documents
IT IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND .
The basics of modification language design was inspired by
and his data manipulation processor for XML Query Language :
(define (sxml:modification-error . tex... |
4bbebf0e6b9301aea763acc385852507416221dd91550908ba0a252f2b9a6670 | exercism/common-lisp | queen-attack-test.lisp | Ensures that and the testing library are always loaded
(eval-when (:compile-toplevel :load-toplevel :execute)
(load "queen-attack")
(quicklisp-client:quickload :fiveam))
;; Defines the testing package with symbols from queen-attack and FiveAM in scope
;; The `run-tests` function is exported for use by both the ... | null | https://raw.githubusercontent.com/exercism/common-lisp/55aa5d6fc8a4f959e14151c119300f6652e6ab30/exercises/practice/queen-attack/queen-attack-test.lisp | lisp | Defines the testing package with symbols from queen-attack and FiveAM in scope
The `run-tests` function is exported for use by both the user and test-runner
Enter the testing package
Define and enter a new FiveAM test-suite | Ensures that and the testing library are always loaded
(eval-when (:compile-toplevel :load-toplevel :execute)
(load "queen-attack")
(quicklisp-client:quickload :fiveam))
(defpackage :queen-attack-test
(:use :cl :fiveam)
(:export :run-tests))
(in-package :queen-attack-test)
(def-suite* queen-attack-suite)
... |
400d17fe13e8f4c6635c5f401038a01f379097e775e461ef4e316839c2df1394 | racket/htdp | info.rkt | #lang info
(define test-omit-paths
'("convert.rkt"
"elevator.rkt"
"dir.rkt"
"graphing.rkt"
"gui.rkt"
"hangman-error.rkt"
"world-mouse.rkt"
"matrix-client.rkt"
"matrix-example.rkt"))
(define test-responsibles '(("gui.rkt" robby)))
| null | https://raw.githubusercontent.com/racket/htdp/aa78794fa1788358d6abd11dad54b3c9f4f5a80b/htdp-test/htdp/tests/info.rkt | racket | #lang info
(define test-omit-paths
'("convert.rkt"
"elevator.rkt"
"dir.rkt"
"graphing.rkt"
"gui.rkt"
"hangman-error.rkt"
"world-mouse.rkt"
"matrix-client.rkt"
"matrix-example.rkt"))
(define test-responsibles '(("gui.rkt" robby)))
| |
8671d517f8e866a1d342b3e8be2e1eb484f9cbab8b17d303733cecacaed3f960 | zyrolasting/polyglot | publish.rkt | #lang racket/base
(require rackunit
aws/s3)
(test-case
"Mime-type selections"
(define (test-pair pair)
(check-equal? ((path->mime-proc) (build-path (car pair))) (cdr pair)))
(for ([pair '(("a.html" . "text/html")
("a.css" . "text/css")
("a.wtf" . "application/x-unk... | null | https://raw.githubusercontent.com/zyrolasting/polyglot/d27ca7fe90fd4ba2a6c5bcd921fce89e72d2c408/polyglot-test/tests/polyglot/publish.rkt | racket | #lang racket/base
(require rackunit
aws/s3)
(test-case
"Mime-type selections"
(define (test-pair pair)
(check-equal? ((path->mime-proc) (build-path (car pair))) (cdr pair)))
(for ([pair '(("a.html" . "text/html")
("a.css" . "text/css")
("a.wtf" . "application/x-unk... | |
3d30135bb3be98b10ca1c5d3fa95de80f82907eada83c6a3ecb4b1bf98d5ca6f | ocaml-sf/learn-ocaml-corpus | varset_pick_better_liar.ml | (* ------------------------------------------------------------------------------ *)
(* Building formulae. *)
let var x =
FVar x
let falsity =
FConst false
let truth =
FConst true
let const sense =
if sense then truth else falsity
(* [FConst sense] would work too, but would allocate memory *)
let neg ... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/sat/wrong/varset_pick_better_liar.ml | ocaml | ------------------------------------------------------------------------------
Building formulae.
[FConst sense] would work too, but would allocate memory
------------------------------------------------------------------------------
Evaluating formulae.
We assume [n < Sys.word_size - 1].
-----------------... |
let var x =
FVar x
let falsity =
FConst false
let truth =
FConst true
let const sense =
if sense then truth else falsity
let neg f =
match f with
| FConst sense ->
const (not sense)
| FNeg f ->
f
| _ ->
FNeg f
let conn sense f1 f2 =
match f1, f2 with
| FConst sense', f
| f... |
182da68dcdfe1185a5785455c4680b406230af2d38bbf88e9ad5100539512b1f | pine-lang/pine | core_test.clj | (ns pine.core-test
(:require [clojure.test :refer :all]
[pine.core :refer :all]
[pine.ast :as ast]
[pine.fixtures.mysql :as fixtures]
))
(deftest pine-prepare:one-operation-no-filter
(testing "Create sql a pine expression containing one operation"
(is
(=
... | null | https://raw.githubusercontent.com/pine-lang/pine/03eaf6b8e2e38334b22aff328767a613f1aceadc/test/pine/core_test.clj | clojure | (ns pine.core-test
(:require [clojure.test :refer :all]
[pine.core :refer :all]
[pine.ast :as ast]
[pine.fixtures.mysql :as fixtures]
))
(deftest pine-prepare:one-operation-no-filter
(testing "Create sql a pine expression containing one operation"
(is
(=
... | |
5e98be6becd047703d93f2d36805a3d0007dbc5b5877ed1dd7094bffa4326a98 | janestreet/core_bench | core_bench_js.ml | include Bench
| null | https://raw.githubusercontent.com/janestreet/core_bench/91cd20e8682649e36cc605fcef6359070736ceef/js/src/core_bench_js.ml | ocaml | include Bench
| |
020427e892cd120b1cd4ef368cdb1848694c4b8ee9fd95782e86b844bc2c1bc1 | mikeplus64/plissken | Main.hs | # LANGUAGE OverloadedStrings , LambdaCase , BangPatterns , ScopedTypeVariables , RankNTypes #
module Main where
import Data.IORef
import Control.Monad
import Control.Applicative
import Control.Monad.State.Strict
import Control.Concurrent
import qualified Graphics.UI.GLFW as GLFW
import Graphics.UI.GLFW (Key(..))
impo... | null | https://raw.githubusercontent.com/mikeplus64/plissken/e872db14c2e6d0df9379f81aaeaa448ca1ade6fd/src/Main.hs | haskell | start/resume button
if the game hasn't started, the label is "start"
otherwise, it's "resume"
ensure that the files actually exist
frame counter
if the menu is not open, draw the game
draw the cursor as a brighter version of a normal stage block
draw the helper message
Draw the snake's head in bright green, an... | # LANGUAGE OverloadedStrings , LambdaCase , BangPatterns , ScopedTypeVariables , RankNTypes #
module Main where
import Data.IORef
import Control.Monad
import Control.Applicative
import Control.Monad.State.Strict
import Control.Concurrent
import qualified Graphics.UI.GLFW as GLFW
import Graphics.UI.GLFW (Key(..))
impo... |
2c647980f91ab93c07cb9382d825777e38092e2ddd348d01d94add5486efcd81 | slyrus/mcclim-old | describe.lisp | ;;; -*- Mode: Lisp; Package: COMMON-LISP -*-
( c ) copyright 2002 by ( )
;;; This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation ; either
version 2 of the License , or ( at your optio... | null | https://raw.githubusercontent.com/slyrus/mcclim-old/354cdf73c1a4c70e619ccd7d390cb2f416b21c1a/describe.lisp | lisp | -*- Mode: Lisp; Package: COMMON-LISP -*-
This library is free software; you can redistribute it and/or
either
This library 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 PARTICULAR PURPOSE. See the GNU
License ... |
( c ) copyright 2002 by ( )
modify it under the terms of the GNU Library General Public
version 2 of the License , or ( at your option ) any later version .
Library General Public License for more details .
You should have received a copy of the GNU Library General Public
Free Software Foundation , In... |
9d4e8c6ce7db4add1c5eb140f91b6803bb23738cd7db672fd622129f2cce4595 | sru-systems/protobuf-simple | OptimizeMode.hs | -- |
Module : Parser .
Copyright : ( c ) 2015 - 2016 < >
License : MIT
Maintainer : < >
--
OptimizeMode type .
module Parser.OptimizeMode where
import qualified Prelude
data OptimizeMode = Speed
| CodeSize
| LiteRuntime
deriving (... | null | https://raw.githubusercontent.com/sru-systems/protobuf-simple/ee0f26b6a8588ed9f105bc9ee72c38943133ed4d/src/Parser/OptimizeMode.hs | haskell | |
| Module : Parser .
Copyright : ( c ) 2015 - 2016 < >
License : MIT
Maintainer : < >
OptimizeMode type .
module Parser.OptimizeMode where
import qualified Prelude
data OptimizeMode = Speed
| CodeSize
| LiteRuntime
deriving (Prelude.... |
ed8b27bae06bc3322e0fac2e80e574f30a03807983f8e2b689f152196d569d1b | alex-hhh/ActivityLog2 | inspect-scatter.rkt | #lang racket/base
;; inspect-scatter.rkt -- scatter plot for a session
;;
;; This file is part of ActivityLog2, an fitness activity tracker
Copyright ( C ) 2015 , 2018 , 2019 , 2020 , 2021 < >
;;
;; This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public ... | null | https://raw.githubusercontent.com/alex-hhh/ActivityLog2/efd2b402e846680d0e5542cde0199616477f0084/rkt/session-inspector/inspect-scatter.rkt | racket | inspect-scatter.rkt -- scatter plot for a session
This file is part of ActivityLog2, an fitness activity tracker
This program is free software: you can redistribute it and/or modify it
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
without even the implied warran... | #lang racket/base
Copyright ( C ) 2015 , 2018 , 2019 , 2020 , 2021 < >
under the terms of the GNU General Public License as published by the Free
Software Foundation , either version 3 of the License , or ( at your option )
(require data-frame
data-frame/private/slr
math/statistics
... |
7b3a6e1f8e154c3559d27822102861e355cb9544873ced30a6e7a6d5ca181bce | vaclavsvejcar/headroom | KVStoreSpec.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE TypeApplications #
# LANGUAGE NoImplicitPrelude #
module Headroom.IO.KVStoreSpec
( spec
)
where
import Headroom.IO.KVStore
import RIO
import RIO.FilePath ((</>))
import qualified RIO.Text as T
import RIO.Time
import Test.Hspec
spec ::... | null | https://raw.githubusercontent.com/vaclavsvejcar/headroom/3b20a89568248259d59f83f274f60f6e13d16f93/test/Headroom/IO/KVStoreSpec.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE RecordWildCards #
# LANGUAGE TypeApplications #
# LANGUAGE NoImplicitPrelude #
module Headroom.IO.KVStoreSpec
( spec
)
where
import Headroom.IO.KVStore
import RIO
import RIO.FilePath ((</>))
import qualified RIO.Text as T
import RIO.Time
import Test.Hspec
spec :: Spec
spec = do
describe "SQLit... |
99e07e79db3375817dafaee0643e7a9d8c991b5ceda50a701896a639bd113c38 | robrix/starlight | GL.hs | # LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
module GL
( Capability(..)
, Capabilities(..)
, enabled_
, runGLC
, GLC(..)
) ... | null | https://raw.githubusercontent.com/robrix/starlight/ad80ab74dc2eedbb52a75ac8ce507661d32f488e/src/GL.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE RankNTypes #
ColourLogicOp -- ^ GL_COLOR_LOGIC_OP
^ GL_CULL_FACE
^ GL_DEPTH_CLAMP
DepthTest -- ^ GL_DEPTH_TEST
^ GL_DITHER
FramebufferSRGB -- ^ GL_FRAMEBUFFER_SRGB
^ GL_LINE_SMOOTH
^ GL_MULTISAMPLE
PolygonOffsetFill -- ^ GL_POLYGON... | # LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
module GL
( Capability(..)
, Capabilities(..)
, enabled_
, runGLC
, GLC(..)
) where
import Control.Algebra
import ... |
4999c263b64e748a5d773e6987028345bfbfc046095028ab0fecbebf90035afa | lihebi/guix-channel | config.scm | ;; This is an operating system configuration generated
;; by the graphical installer.
(use-modules (gnu)
(srfi srfi-1)
(guix profiles)
(guix packages)
(nvidia))
(use-service-modules desktop networking ssh xorg web)
(use-package-modules base bash linux ssh perl lisp)
... | null | https://raw.githubusercontent.com/lihebi/guix-channel/80543d889478d3186628d1014098ed36a93d7db3/machine/config.scm | scheme | This is an operating system configuration generated
by the graphical installer.
(specification->package "xmonad")
(specification->package "sway")
when not using guix, use /etc/nginx/nginx.conf
config test fail and service cannot be started
FIXME localhost? This does not seem important
because x permission is no... |
(use-modules (gnu)
(srfi srfi-1)
(guix profiles)
(guix packages)
(nvidia))
(use-service-modules desktop networking ssh xorg web)
(use-package-modules base bash linux ssh perl lisp)
(use-modules (nongnu packages linux))
(define %root (file-system
(mou... |
6d91508558553f43076ff71686834397c529600dfa958dfafd14898defacd573 | slyrus/mcclim-old | mp-acl.lisp | ;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: CLIM-INTERNALS; -*-
;;; ---------------------------------------------------------------------------
Title : CLIM-2 , Chapter 32.2 Multi - processing
for ACL
Created : 2001 - 05 - 22
Author : < >
;;; License: LGPL (See file COPYING for de... | null | https://raw.githubusercontent.com/slyrus/mcclim-old/354cdf73c1a4c70e619ccd7d390cb2f416b21c1a/Lisp-Dep/mp-acl.lisp | lisp | -*- Mode: Lisp; Syntax: Common-Lisp; Package: CLIM-INTERNALS; -*-
---------------------------------------------------------------------------
License: LGPL (See file COPYING for details).
---------------------------------------------------------------------------
This library is free software; you can redistribu... | Title : CLIM-2 , Chapter 32.2 Multi - processing
for ACL
Created : 2001 - 05 - 22
Author : < >
( c ) copyright 2001 by
modify it under the terms of the GNU Library General Public
version 2 of the License , or ( at your option ) any later version .
Library General Public Licens... |
8dce3766667428477b4d35a0f1755ef51a9ba5a3e57d8a494341395cf9f7b22d | informatimago/lisp | simple-symbol.lisp | (eval-when (:compile-toplevel :load-toplevel :execute)
(setf *readtable* (copy-readtable nil)))
(defparameter bf$symbols '())
(defun bf$intern (name)
(let ((ass (assoc name bf$symbols :test (function equal))))
(if ass
(cdr ass)
(let ((sym (cons :$symbol (list :pname name))))
(setf b... | null | https://raw.githubusercontent.com/informatimago/lisp/571af24c06ba466e01b4c9483f8bb7690bc46d03/small-cl-pgms/brainfuck/simple-symbol.lisp | lisp | (eval-when (:compile-toplevel :load-toplevel :execute)
(setf *readtable* (copy-readtable nil)))
(defparameter bf$symbols '())
(defun bf$intern (name)
(let ((ass (assoc name bf$symbols :test (function equal))))
(if ass
(cdr ass)
(let ((sym (cons :$symbol (list :pname name))))
(setf b... | |
84fe118d88a8e8341c4c74030ab5cdc2b044945c61f9798c31a0824c70069fa6 | earl-ducaine/cl-garnet | motif-save-gadget.lisp | -*- Mode : LISP ; Syntax : Common - Lisp ; Package : GARNETDRAW ; Base : 10 -*-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
The Garnet User Interface Development Environment . ; ; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; This code was wr... | null | https://raw.githubusercontent.com/earl-ducaine/cl-garnet/f0095848513ba69c370ed1dc51ee01f0bb4dd108/src/gadgets/motif-save-gadget.lisp | lisp | Syntax : Common - Lisp ; Package : GARNETDRAW ; Base : 10 -*-
; ;
This code was written as part of the Garnet project at ;;;
; ;
; ;
please contact to be put on the mailing list. ;;;
This file contains the save gadget. The functions for this gadget
can be found in the save-load-functions.lisp file... |
Designed and Implemented by
06/16/94 - Changed Mac directory to " : " " . : " - does not work
05/05/94 Mac directory " . : "
10/06/93 - : background - color --- > : foreground - color
01/30/93 - value'd the : initialize slot
12/15/92 - Added type and parameter declarations
08/2... |
d07830c7cb67bf5b5d314b80f0cfba47c466b072393022648b22f90ea5a23397 | arthaud/c2bf | c2bf.ml | open Types
open Ast
open Printf
type token =
|Goto of int
|Left
|Right
|Incr
|Decr
|Out
|In
|OBrac
|CBrac
|Debug of string
type brainfuck = token list
string_of_token : token - > string
let string_of_token = function
|Goto x -> sprintf "Goto(%d)" x
|Left -> "Left"
... | null | https://raw.githubusercontent.com/arthaud/c2bf/e4e76604483483dcbec3c7a0f9a3defcc6480cd8/src/c2bf.ml | ocaml | string_of_brainfuck : brainfuck -> string
compile_brainfuck : brainfuck -> string
repeat : 'a -> int -> 'a list
range : int -> int -> int list
charlist_of_string : string -> char list
helpful operations
see
bf_add : int -> int -> brainfuck
* add y to x
*
* precondition: no
* postcondition: x' = x + ... | open Types
open Ast
open Printf
type token =
|Goto of int
|Left
|Right
|Incr
|Decr
|Out
|In
|OBrac
|CBrac
|Debug of string
type brainfuck = token list
string_of_token : token - > string
let string_of_token = function
|Goto x -> sprintf "Goto(%d)" x
|Left -> "Left"
... |
46898b79288fd8c8a30d6b7d7fd6d3fbfc5d266fce1d9721bc1ae77578772e14 | Sword-Smith/Sword | Main.hs | MIT License
--
Copyright ( c ) 2019 and
--
-- 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, mer... | null | https://raw.githubusercontent.com/Sword-Smith/Sword/214da8011eec75fb949bdc52418b269ab329b2c6/src/Main.hs | haskell |
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furnished to do so, subject to the following conditions:
The above copyright notice... | MIT License
Copyright ( c ) 2019 and
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , E... |
a508c672a984a0464723b92db029951bb26fd81b1205c3ab2f6f0402d21531d9 | haskell/haskell-ide-engine | BuildSystem.hs | # LANGUAGE CPP #
module BuildSystem where
buildSystem :: String
buildSystem =
#if RUN_FROM_STACK
"stack"
#else
"cabal"
#endif
isRunFromStack :: Bool
isRunFromStack = buildSystem == "stack"
isRunFromCabal :: Bool
isRunFromCabal = buildSystem == "cabal"
| null | https://raw.githubusercontent.com/haskell/haskell-ide-engine/d84b84322ccac81bf4963983d55cc4e6e98ad418/install/src/BuildSystem.hs | haskell | # LANGUAGE CPP #
module BuildSystem where
buildSystem :: String
buildSystem =
#if RUN_FROM_STACK
"stack"
#else
"cabal"
#endif
isRunFromStack :: Bool
isRunFromStack = buildSystem == "stack"
isRunFromCabal :: Bool
isRunFromCabal = buildSystem == "cabal"
| |
ff4045df9c469a866fbfdf8c7889ae6b9f94c7ddb12ffa5349902c07eaf6990a | rtoy/cmucl | srctran.lisp | ;; Tests for various source transformations.
(defpackage :srctran-tests
(:use :cl :lisp-unit))
(in-package "SRCTRAN-TESTS")
(define-test floor-quotient-bound
"Test the first value of FLOOR returns the correct interval"
(assert-equalp (c::make-interval :low 0 :high 10)
(c::floor-quotient-bound
(c::make-i... | null | https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/tests/srctran.lisp | lisp | Tests for various source transformations. |
(defpackage :srctran-tests
(:use :cl :lisp-unit))
(in-package "SRCTRAN-TESTS")
(define-test floor-quotient-bound
"Test the first value of FLOOR returns the correct interval"
(assert-equalp (c::make-interval :low 0 :high 10)
(c::floor-quotient-bound
(c::make-interval :low 0.3 :high 10.3)))
(assert-equa... |
10d8a6601b54497fb18ec45f8dadcc666409f7591623592c57a10c6a44bdf5b1 | chaoxu/fancy-walks | C.hs | {-# OPTIONS_GHC -O2 #-}
import Data.List
import Data.Maybe
import Data.Char
import Data.Array
import Data.Int
import Data.Ratio
import Data.Bits
import Data.Function
import Data.Ord
import Control.Monad.State
import Control.Monad
import Control.Applicative
import Data.ByteString.Char8 (ByteString)
import qualified Dat... | null | https://raw.githubusercontent.com/chaoxu/fancy-walks/952fcc345883181144131f839aa61e36f488998d/code.google.com/codejam/Code%20Jam%20Africa%20and%20Arabia%202011/Online%20Competition/C.hs | haskell | # OPTIONS_GHC -O2 # |
import Data.List
import Data.Maybe
import Data.Char
import Data.Array
import Data.Int
import Data.Ratio
import Data.Bits
import Data.Function
import Data.Ord
import Control.Monad.State
import Control.Monad
import Control.Applicative
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as BS... |
8ffdd98312ebf182ea63c82e284ca15eccf98c7f4ea36050027cfba491e9f9fd | CodyReichert/qi | enc-ebcdic-int.lisp | (in-package #:babel-encodings)
(define-character-encoding :ebcdic-international
"An 8-bit, fixed-width character encoding from IBM.")
(defparameter +ebcdic-int-to-unicode+
#(0 1 2 3 156 9 134 127 151 141 142 11 12 13 14 15 16 17 18 19 157 133 8 135
24 25 146 143 28 29 30 31 128 129 130 65535 132 10 23 27 65... | null | https://raw.githubusercontent.com/CodyReichert/qi/9cf6d31f40e19f4a7f60891ef7c8c0381ccac66f/dependencies/babel-latest/src/enc-ebcdic-int.lisp | lisp | (in-package #:babel-encodings)
(define-character-encoding :ebcdic-international
"An 8-bit, fixed-width character encoding from IBM.")
(defparameter +ebcdic-int-to-unicode+
#(0 1 2 3 156 9 134 127 151 141 142 11 12 13 14 15 16 17 18 19 157 133 8 135
24 25 146 143 28 29 30 31 128 129 130 65535 132 10 23 27 65... | |
17201ddf82b401a3340beb32939497f31fdd9ff6f99e3c0b722f8829898b04ab | e-bigmoon/haskell-blog | Expr.hs | {-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
# LANGUAGE PolyKinds #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Expr where
import Data.Extensible
import Data.Functor.Identity
imp... | null | https://raw.githubusercontent.com/e-bigmoon/haskell-blog/5c9e7c25f31ea6856c5d333e8e991dbceab21c56/sample-code/2019/09-09/Expr.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE DataKinds #
# LANGUAGE RankNTypes # | # LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Expr where
import Data.Extensible
import Data.Functor.Identity
import Data.Kind
import GHC.TypeLits
class Expr expr where
type FieldList expr :: [Assoc Symbol Type]
liftExp... |
978da86c8415731c475e9cd8370263a38f519724e2f21584381926803745e32d | v-kolesnikov/sicp | 1_03.clj | (ns sicp.chapter01.1-03)
(defn solution
[a b c]
(let [square (fn [x] (* x x))
peaks (take-last 2 (sort [a b c]))]
(+ (square (first peaks))
(square (second peaks)))))
| null | https://raw.githubusercontent.com/v-kolesnikov/sicp/4298de6083440a75898e97aad658025a8cecb631/src/sicp/chapter01/1_03.clj | clojure | (ns sicp.chapter01.1-03)
(defn solution
[a b c]
(let [square (fn [x] (* x x))
peaks (take-last 2 (sort [a b c]))]
(+ (square (first peaks))
(square (second peaks)))))
| |
14554298067902c2a22a449bf3f482e639bda913f50ad901b90a679f4247743b | mitchellwrosen/planet-mitchell | IO.hs | module IO
( -- * IO
IO
, MonadIO(..)
, fixIO
, timeout
, once
, onceFork
*
, Memoized
, runMemoized
, memoizeMVar
-- * IO exceptions
, module System.IO.Error
) where
import Control.Concurrent.Extra (once, onceFork)
import Control.Monad.IO.Class (MonadIO(..))
import System.IO
import ... | null | https://raw.githubusercontent.com/mitchellwrosen/planet-mitchell/18dd83204e70fffcd23fe12dd3a80f70b7fa409b/planet-mitchell/src/IO.hs | haskell | * IO
* IO exceptions | module IO
IO
, MonadIO(..)
, fixIO
, timeout
, once
, onceFork
*
, Memoized
, runMemoized
, memoizeMVar
, module System.IO.Error
) where
import Control.Concurrent.Extra (once, onceFork)
import Control.Monad.IO.Class (MonadIO(..))
import System.IO
import System.IO.Error
import UnliftIO.Mem... |
a706218792a2cbe9382bfeef81cac6e0787a2b93ea18d56daac7e61153aa082e | marigold-dev/deku | ticket_id.ml | open Tezos_micheline
open Deku_stdlib
type t = { ticketer : Address.t; data : bytes } [@@deriving eq, ord]
let parse_micheline string =
let tokens, errors = Micheline_parser.tokenize string in
match errors with
| [] -> (
let micheline, errors = Micheline_parser.parse_expression tokens in
match error... | null | https://raw.githubusercontent.com/marigold-dev/deku/cdf82852196b55f755f40850515580be4fd9a3fa/deku-p/src/core/tezos/ticket_id.ml | ocaml | open Tezos_micheline
open Deku_stdlib
type t = { ticketer : Address.t; data : bytes } [@@deriving eq, ord]
let parse_micheline string =
let tokens, errors = Micheline_parser.tokenize string in
match errors with
| [] -> (
let micheline, errors = Micheline_parser.parse_expression tokens in
match error... | |
5f5513b1ac6407196efe8d37cf8b1afff64beed06aa0f248f83d978e32aa3b9b | realworldocaml/book | per_item.ml | open Import
module Make (Key : Map.Key) : Per_item_intf.S with type key = Key.t = struct
module Map = Map.Make (Key)
type key = Key.t
type 'a t =
{ map : int Map.t
; values : 'a array
}
let equal f t { values; map } =
Array.equal f t.values values && Map.equal ~equal:Int.equal t.map map
l... | null | https://raw.githubusercontent.com/realworldocaml/book/d822fd065f19dbb6324bf83e0143bc73fd77dbf9/duniverse/dune_/src/dune_rules/per_item.ml | ocaml | open Import
module Make (Key : Map.Key) : Per_item_intf.S with type key = Key.t = struct
module Map = Map.Make (Key)
type key = Key.t
type 'a t =
{ map : int Map.t
; values : 'a array
}
let equal f t { values; map } =
Array.equal f t.values values && Map.equal ~equal:Int.equal t.map map
l... | |
35e417e7cde15d52c6b2de418b638db406aaf47099b5e9604848a923e05c6c67 | sjl/advent | day-11.lisp | (advent:defpackage* :advent/2018/11
(:shadow :x :y))
(in-package :advent/2018/11)
(defun cell (x y)
(complex x y))
(defun x (cell)
(realpart cell))
(defun y (cell)
(imagpart cell))
(defun rack-id (cell)
(+ (x cell) 10))
(defun power-level (serial-number cell)
(_ (rack-id cell)
(* _ (y cell))
(+... | null | https://raw.githubusercontent.com/sjl/advent/dc3debda9bd1a0570a6ab06919b1af7b285413dc/src/2018/days/day-11.lisp | lisp | (advent:defpackage* :advent/2018/11
(:shadow :x :y))
(in-package :advent/2018/11)
(defun cell (x y)
(complex x y))
(defun x (cell)
(realpart cell))
(defun y (cell)
(imagpart cell))
(defun rack-id (cell)
(+ (x cell) 10))
(defun power-level (serial-number cell)
(_ (rack-id cell)
(* _ (y cell))
(+... | |
ef0f98391bd7e5a981c052787835178b312374762029dc635d0409dca147ac70 | htmfilho/minimily | account.clj | (ns minimily.accounting.web.ctrl.account
(:require [ring.util.response :refer [redirect]]
[minimily.accounting.web.ui.account :as account-view]
[minimily.accounting.model.account :as account-model]
[minimily.accounting.model.transaction :as transac... | null | https://raw.githubusercontent.com/htmfilho/minimily/ac27231b4b0e63a0dba747aa4dd972f39bb23ecd/src/minimily/accounting/web/ctrl/account.clj | clojure | (ns minimily.accounting.web.ctrl.account
(:require [ring.util.response :refer [redirect]]
[minimily.accounting.web.ui.account :as account-view]
[minimily.accounting.model.account :as account-model]
[minimily.accounting.model.transaction :as transac... | |
9b37624d07cb797d024aa46bfed67146b190ef635aa6d2dce9c8740d12a55fec | metaocaml/ber-metaocaml | t210-setfield3.ml | TEST
include tool - ocaml - lib
flags = " -w a "
ocaml_script_as_argument = " true "
* setup - ocaml - build - env
* *
include tool-ocaml-lib
flags = "-w a"
ocaml_script_as_argument = "true"
* setup-ocaml-build-env
** ocaml
*)
open Lib;;
type t = {
mutable a : int;
mutable b : int;
mutable c : int;... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tests/tool-ocaml/t210-setfield3.ml | ocaml | TEST
include tool - ocaml - lib
flags = " -w a "
ocaml_script_as_argument = " true "
* setup - ocaml - build - env
* *
include tool-ocaml-lib
flags = "-w a"
ocaml_script_as_argument = "true"
* setup-ocaml-build-env
** ocaml
*)
open Lib;;
type t = {
mutable a : int;
mutable b : int;
mutable c : int;... | |
918db616aff6a4b7761bebd7144c016fbaa8e3b5322950189585d125489f20c2 | intermine/bluegenes | views.cljs | (ns bluegenes.pages.home.views
(:require [re-frame.core :refer [subscribe dispatch]]
[reagent.core :as r]
[bluegenes.route :as route]
[bluegenes.components.icons :refer [icon icon-comp]]
[bluegenes.components.navbar.nav :refer [mine-icon]]
[bluegenes.compone... | null | https://raw.githubusercontent.com/intermine/bluegenes/c4f8a9ec286c218aa31321fba1a1c888eaaee7f1/src/cljs/bluegenes/pages/home/views.cljs | clojure | Only prepend 'v' if release starts with a digit.
This MUST be a function, as otherwise `route/href` would get invoked when
the namespace is required, which depends on a subscription which might not
be registered in time, causing a crash. | (ns bluegenes.pages.home.views
(:require [re-frame.core :refer [subscribe dispatch]]
[reagent.core :as r]
[bluegenes.route :as route]
[bluegenes.components.icons :refer [icon icon-comp]]
[bluegenes.components.navbar.nav :refer [mine-icon]]
[bluegenes.compone... |
a0d7fcb0b641e960822e3f90777c6b37b0142eebe35f05a30999d5a9cda370c0 | magnars/test-with-files | tools.clj | (ns test-with-files.tools
(:require [clojure.java.io :as io])
(:import java.nio.file.Files
java.nio.file.attribute.FileAttribute))
(defn delete-file-recursively [f]
(let [f (io/file f)]
(if (.isDirectory f)
(doseq [child (.listFiles f)]
(delete-file-recursively child)))
(io/delet... | null | https://raw.githubusercontent.com/magnars/test-with-files/1b972785831b3b1fdbe81221365126b135e93695/src/test_with_files/tools.clj | clojure | (ns test-with-files.tools
(:require [clojure.java.io :as io])
(:import java.nio.file.Files
java.nio.file.attribute.FileAttribute))
(defn delete-file-recursively [f]
(let [f (io/file f)]
(if (.isDirectory f)
(doseq [child (.listFiles f)]
(delete-file-recursively child)))
(io/delet... | |
2333e02b73db2fe37ca6561c5783b594b80393d8a8548f06ece740ad320d9f24 | haskell/time | NominalDiffTime.hs | # LANGUAGE InstanceSigs #
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
# LANGUAGE Trustworthy #
module Data.Time.Clock.Internal.NominalDiffTime (
NominalDiffTime,
secondsToNominalDiffTime,
nominalDiffTimeToSeconds,
nominalDay,
) where
import Control.DeepSeq
import Data.Data
import Data.Fixed
... | null | https://raw.githubusercontent.com/haskell/time/857d8fd808548b2bf652236443adcbeae9188745/lib/Data/Time/Clock/Internal/NominalDiffTime.hs | haskell | | This is a length of time, as measured by UTC.
Conversion functions such as 'fromInteger' and 'realToFrac' will treat it as seconds.
It ignores leap-seconds, so it's not necessarily a fixed amount of clock time.
regardless of whether a leap-second intervened.
| Create a 'NominalDiffTime' from a number of secon... | # LANGUAGE InstanceSigs #
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
# LANGUAGE Trustworthy #
module Data.Time.Clock.Internal.NominalDiffTime (
NominalDiffTime,
secondsToNominalDiffTime,
nominalDiffTimeToSeconds,
nominalDay,
) where
import Control.DeepSeq
import Data.Data
import Data.Fixed
... |
06bcc56a3073d903d8d8be3a360e0dbf5b47bf673002ee4ce559cbc09df7624d | nuvla/api-server | vulnerability_lifecycle_test.clj | (ns sixsq.nuvla.server.resources.vulnerability-lifecycle-test
(:require
[clojure.data.json :as json]
[clojure.test :refer [deftest is use-fixtures]]
[peridot.core :refer [content-type header request session]]
[sixsq.nuvla.server.app.params :as p]
[sixsq.nuvla.server.middleware.authn-info :refer [a... | null | https://raw.githubusercontent.com/nuvla/api-server/272c1b8f7a5cd306d01464cf801d6174df146f71/code/test/sixsq/nuvla/server/resources/vulnerability_lifecycle_test.clj | clojure | admin query succeeds but is empty
anon query fails
user query succeeds, but doesn't have add operation as admin
anon create must fail
user create must fail
check vulnerability creation
verify contents of admin vulnerability
verify that an edit works
user cannot delete the vulnerability
admin can delete the vu... | (ns sixsq.nuvla.server.resources.vulnerability-lifecycle-test
(:require
[clojure.data.json :as json]
[clojure.test :refer [deftest is use-fixtures]]
[peridot.core :refer [content-type header request session]]
[sixsq.nuvla.server.app.params :as p]
[sixsq.nuvla.server.middleware.authn-info :refer [a... |
67ac7eb4189797191de34d96efd0ed9c57779b3954122f955334c343918baf55 | vernemq/vmq-discovery | vmq_discovery_manual.erl | Copyright 2018 Octavo Labs AG Zurich Switzerland ( )
%%
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... | null | https://raw.githubusercontent.com/vernemq/vmq-discovery/6d25de3c0923c49bf6704543f537b1da56e8588d/src/backends/vmq_discovery_manual.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 perm... | Copyright 2018 Octavo Labs AG Zurich Switzerland ( )
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(vmq_discovery_manual).
-author("Dairon Medina <>").
-behaviour(vmq_discovery_backend).
-export([list_nodes/0,... |
e968c5cd5afef6d3ff875b9a475233de06b63a93834ff1b39c6f52fdc50cfb74 | janestreet/core | list.ml | * @inline
(* This function is staged to indicate that real work (the functor application) takes
place after a partial application. *)
let stable_dedup_staged (type a) ~(compare : a -> a -> int)
: (a list -> a list) Base.Staged.t
=
let module Set =
Set.Make (struct
type t = a
let compare = com... | null | https://raw.githubusercontent.com/janestreet/core/4b6635d206f7adcfac8324820d246299d6f572fe/core/src/list.ml | ocaml | This function is staged to indicate that real work (the functor application) takes
place after a partial application. | * @inline
let stable_dedup_staged (type a) ~(compare : a -> a -> int)
: (a list -> a list) Base.Staged.t
=
let module Set =
Set.Make (struct
type t = a
let compare = compare
[ stable_dedup_list ] never calls these
let t_of_sexp _ = assert false
let sexp_of_t _ = assert false
e... |
83efc2a933403831005fbcf562fc1ecda86c18a75737803304d90816be7cc4a5 | ghcjs/ghcjs | t4235.hs | # LANGUAGE TypeFamilies , StandaloneDeriving , FlexibleInstances , GADTs #
module Main where
import Data.Ix
Deriving with phantom type parameter
data T a = R | S | T deriving( Enum, Show )
-- Tests that deriving works for data families
data family Foo a
data instance Foo Int
= A | B | C | D
deriving (Eq, Enu... | null | https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/test/ghc/indexed-types/t4235.hs | haskell | Tests that deriving works for data families | # LANGUAGE TypeFamilies , StandaloneDeriving , FlexibleInstances , GADTs #
module Main where
import Data.Ix
Deriving with phantom type parameter
data T a = R | S | T deriving( Enum, Show )
data family Foo a
data instance Foo Int
= A | B | C | D
deriving (Eq, Enum)
f :: Foo Int -> Bool
f A = True
f B = False... |
97962b8070576376344a319f7dff292bd1505e7f5aa2686db88dd86f473b08cf | Apress/beg-haskell | FunctorsFoldables.hs | module Chapter4.FunctorsFoldables where
import Chapter4.MinimumPrice
import qualified Data.Map as M
import qualified Data.Tree as T
modifyTravelGuidePrice :: Double -> [TravelGuide] -> [TravelGuide]
modifyTravelGuidePrice m = map (\tg -> tg { price = m * price tg })
modifyTravelGuidePriceMap :: Double -> M.Map a T... | null | https://raw.githubusercontent.com/Apress/beg-haskell/aaacbf047d553e6177c38807e662cc465409dffd/chapter4/src/Chapter4/FunctorsFoldables.hs | haskell | module Chapter4.FunctorsFoldables where
import Chapter4.MinimumPrice
import qualified Data.Map as M
import qualified Data.Tree as T
modifyTravelGuidePrice :: Double -> [TravelGuide] -> [TravelGuide]
modifyTravelGuidePrice m = map (\tg -> tg { price = m * price tg })
modifyTravelGuidePriceMap :: Double -> M.Map a T... | |
fb2a5aca00af7f45c61de5ca20169d86effdc2a0e9117bb31f6cb2aaf73d34b5 | tmattio/js-bindings | vscode_languageclient_uuid.mli | [@@@ocaml.warning "-7-11-32-33-39"]
[@@@js.implem [@@@ocaml.warning "-7-11-32-33-39"]]
open Es5
module UUID : sig
type t
val t_to_js : t -> Ojs.t
val t_of_js : Ojs.t -> t
val as_hex : t -> string [@@js.call "asHex"]
val equals : t -> other:t -> bool [@@js.call "equals"]
end
[@@js.scope "UUID"]
val emp... | null | https://raw.githubusercontent.com/tmattio/js-bindings/f1d36bba378e4ecd5310542a0244dce9258b6496/lib/vscode-languageclient/vscode_languageclient_uuid.mli | ocaml | [@@@ocaml.warning "-7-11-32-33-39"]
[@@@js.implem [@@@ocaml.warning "-7-11-32-33-39"]]
open Es5
module UUID : sig
type t
val t_to_js : t -> Ojs.t
val t_of_js : Ojs.t -> t
val as_hex : t -> string [@@js.call "asHex"]
val equals : t -> other:t -> bool [@@js.call "equals"]
end
[@@js.scope "UUID"]
val emp... | |
c57e50fd9b5408294485bfb89eb0c59741bb91a1ec5190f58069115bbea48c76 | fterrier/pylos | game_runner.clj | (ns system.game-runner
(:require [com.stuartsierra.component :as component]
[server.game-runner :refer [game-runner get-routes
start-game-runner
stop-game-runner]]
[clojure.core.async :refer [close!]]))
(defreco... | null | https://raw.githubusercontent.com/fterrier/pylos/f9283cf58a32000ed271e768ab6151ac081ed37d/src/clj/system/game_runner.clj | clojure | (ns system.game-runner
(:require [com.stuartsierra.component :as component]
[server.game-runner :refer [game-runner get-routes
start-game-runner
stop-game-runner]]
[clojure.core.async :refer [close!]]))
(defreco... | |
a4cad11f9141c7bb8d0c65bec174c59b10570b16f6b7be95b589f194355899c8 | Simre1/neorg-haskell-parser | Utils.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE UndecidableInstances #
module Neorg.Parser.Utils where
import Cleff
import Cleff.Reader
import Cleff.State
import Control.Applicative (Alternative (many, (<|>)))
import Control.Monad (guard)
import Control.Monad.Trans.Class (lift)
import Data.Char (isLetter)
import Data.Functo... | null | https://raw.githubusercontent.com/Simre1/neorg-haskell-parser/78e6003843571b06e6655d9f487000dc14162736/src/Neorg/Parser/Utils.hs | haskell | # LANGUAGE BangPatterns #
tokensToChunk _ = P.tokensToChunk (Proxy @s)
chunkToTokens _ = P.chunkToTokens (Proxy @s)
P.unParser
p
(mapStateInto s)
where
mapStateInto :: P.State s x -> P.State (Embed s embedInfo) x
mapStateInto s =
in P.State
P.stateOffset = P.sta... | # LANGUAGE UndecidableInstances #
module Neorg.Parser.Utils where
import Cleff
import Cleff.Reader
import Cleff.State
import Control.Applicative (Alternative (many, (<|>)))
import Control.Monad (guard)
import Control.Monad.Trans.Class (lift)
import Data.Char (isLetter)
import Data.Functor (void, ($>), (<&>))
import D... |
7c18e78f3e6525f5e481c1c0ccf3c3c46106d6222bdafb0557925e7bbcb43d5a | ghcjs/ghcjs | Run.hs | # LANGUAGE CPP #
ghcjs - run runs a program compiled by ghcjs with node.js
ghcjs-run runs a program compiled by ghcjs with node.js
-}
module Main where
import Control.Applicative
import Data.Char
import System.Directory
import System.Environment
import System.Exit
import System.FilePath
import System.Pro... | null | https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/src-bin/Run.hs | haskell | # LANGUAGE CPP #
ghcjs - run runs a program compiled by ghcjs with node.js
ghcjs-run runs a program compiled by ghcjs with node.js
-}
module Main where
import Control.Applicative
import Data.Char
import System.Directory
import System.Environment
import System.Exit
import System.FilePath
import System.Pro... | |
1384b2d7c08aa322fcd315a085942e03c4b2108a0afc57d5e5680c3d5a9240c8 | msimon/chip8js | about.ml | {client{
open Eliom_content
open Html5
open D
let what_is_chip8 () =
div ~a:[ a_class [ "what_is_chip8" ]] [
h2 [ pcdata "What is chip8 ?" ];
div [
p [
Raw.a ~a:[ a_href "-8"; a_target "_blank" ] [
pcdata "From wikipedia: "
];
span [
... | null | https://raw.githubusercontent.com/msimon/chip8js/67f6ea0e25a2cc2287b6915c4ca2639a9d64c632/src/about.ml | ocaml | {client{
open Eliom_content
open Html5
open D
let what_is_chip8 () =
div ~a:[ a_class [ "what_is_chip8" ]] [
h2 [ pcdata "What is chip8 ?" ];
div [
p [
Raw.a ~a:[ a_href "-8"; a_target "_blank" ] [
pcdata "From wikipedia: "
];
span [
... | |
b80cdabc22a160a5daae140b409bc64a12fdcc8427cbfa712f4defc58fecdce1 | Paczesiowa/virthualenv | SanityCheck.hs | module SanityCheck (sanityCheck) where
import Control.Monad (when)
import System.Directory (doesDirectoryExist)
import Util.IO (getEnvVar, which)
import Types
import MyMonad
import Paths (vheDirStructure)
-- check if any virtual env is already active
checkVHE :: MyMonad ()
checkVHE = do
virthualEnvVar <- liftIO ... | null | https://raw.githubusercontent.com/Paczesiowa/virthualenv/aab89dad9de7dac5268472eaa50c11eb40b02380/src/SanityCheck.hs | haskell | check if any virtual env is already active
check if cabal binary exist on PATH
check if everything is sane | module SanityCheck (sanityCheck) where
import Control.Monad (when)
import System.Directory (doesDirectoryExist)
import Util.IO (getEnvVar, which)
import Types
import MyMonad
import Paths (vheDirStructure)
checkVHE :: MyMonad ()
checkVHE = do
virthualEnvVar <- liftIO $ getEnvVar "VIRTHUALENV"
case virthualEnv... |
91e58befa52a2395f60b574423b2b405f272a626efe7963255c6120d42e2c41b | sklassen/erlang-linalg-native | linalg_lu_tests.erl | -module(linalg_lu_tests).
-import(linalg, [lu/1]).
-include_lib("eunit/include/eunit.hrl").
lu_3_test() ->
?assertEqual(
{[[0, 1, 0], [1, 0, 0], [0, 0, 1]], [[1, 0, 0], [0.5, 1, 0], [0.5, -1.0, 1]], [
[2.0, 4.0, 7.0], [0, 1.0, 1.5], [0, 0, -2.0]
]},
lu([[1, 3, 5], [2, 4, 7], [1,... | null | https://raw.githubusercontent.com/sklassen/erlang-linalg-native/b31eef532b9fe2be7ecbff52a060ccdc833b4dca/test/linalg_lu_tests.erl | erlang | -module(linalg_lu_tests).
-import(linalg, [lu/1]).
-include_lib("eunit/include/eunit.hrl").
lu_3_test() ->
?assertEqual(
{[[0, 1, 0], [1, 0, 0], [0, 0, 1]], [[1, 0, 0], [0.5, 1, 0], [0.5, -1.0, 1]], [
[2.0, 4.0, 7.0], [0, 1.0, 1.5], [0, 0, -2.0]
]},
lu([[1, 3, 5], [2, 4, 7], [1,... | |
c039c90198e838716fc73e7c4b88e4a34f656c21aceb3b34bad4cef444959a07 | tamarin-prover/tamarin-prover | Types.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
# LANGUAGE Rank2Types #
# LANGUAGE TemplateHaskell #
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ViewPatterns #-}
# LANGUAGE DeriveGeneric #
{-# LANGUAGE DeriveAnyClass #-}
# OPTIONS_GHC -fno - warn - orphans #
|
Mod... | null | https://raw.githubusercontent.com/tamarin-prover/tamarin-prover/958f8b1767650c06dffe4eba63a38508c9b17a7f/src/Web/Types.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE QuasiQuotes #
# LANGUAGE TypeFamilies #
# LANGUAGE ViewPatterns #
# LANGUAGE DeriveAnyClass #
, URL rendering function
Image rendering
import Control.Applicative
----------------------------------------------------------------------------
Types
... | # LANGUAGE Rank2Types #
# LANGUAGE TemplateHaskell #
# LANGUAGE DeriveGeneric #
# OPTIONS_GHC -fno - warn - orphans #
|
Module : Types.hs
Description : Central data type and instances .
Copyright : ( c ) 2011
License : GPL-3
Maintainer : < >
Stability ... |
2dc89313190e9de128ee3ef456f8b942f33b310bbc4e3b68d6398a27d184bbe5 | softwarelanguageslab/maf | R5RS_various_lambda-update-5.scm | ; Changes:
* removed : 1
* added : 0
* swaps : 0
; * negated predicates: 0
; * swapped branches: 0
; * calls to id fun: 0
(letrec ((the-lambda ())
(update-lambda! (lambda (n)
(set! the-lambda (lambda ()
n)))))
(<change>
(upda... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_various_lambda-update-5.scm | scheme | Changes:
* negated predicates: 0
* swapped branches: 0
* calls to id fun: 0 | * removed : 1
* added : 0
* swaps : 0
(letrec ((the-lambda ())
(update-lambda! (lambda (n)
(set! the-lambda (lambda ()
n)))))
(<change>
(update-lambda! 0)
())
(update-lambda! 1)
(letrec ((res (the-lambda)))
... |
8d4b5bb1a5ef1b2061bac1a798a17f979e7a036b545489c47e67fbbb3f93f88d | tud-fop/vanda-haskell | Main.hs | -----------------------------------------------------------------------------
-- |
-- Module : Main
Description : unified Vanda command line tool
Copyright : ( c ) Technische Universität Dresden 2015
-- License : BSD-style
--
-- Maintainer :
-- Stability : unknown
-- Portability : portable
... | null | https://raw.githubusercontent.com/tud-fop/vanda-haskell/3214966361b6dbf178155950c94423eee7f9453e/executable/Main.hs | haskell | ---------------------------------------------------------------------------
|
Module : Main
License : BSD-style
Maintainer :
Stability : unknown
Portability : portable
tool with several sub-commands.
--------------------------------------------------------------------------- | Description : unified Vanda command line tool
Copyright : ( c ) Technische Universität Dresden 2015
Brings together all functionality to provide a unified command line
" System . Console . . Explicit " is used to provide the command line interface . The actual work is done in other @Main@ modules . The... |
04859fab307367fddf72ccb37b34a6420ab03651012e4a443db6456fdfdc54d8 | sellout/haskerwaul | Cartesian.hs | # language UndecidableSuperClasses #
module Haskerwaul.Functor.Closed.Cartesian
( module Haskerwaul.Functor.Closed.Cartesian
-- * extended modules
, module Haskerwaul.Functor.Monoidal.Closed
) where
import Haskerwaul.Category.Monoidal.Closed.Cartesian
import Haskerwaul.Functor.Monoidal.Closed
-- | [nLab](+cl... | null | https://raw.githubusercontent.com/sellout/haskerwaul/cf54bd7ce5bf4f3d1fd0d9d991dc733785b66a73/src/Haskerwaul/Functor/Closed/Cartesian.hs | haskell | * extended modules
| [nLab](+closed+functor) | # language UndecidableSuperClasses #
module Haskerwaul.Functor.Closed.Cartesian
( module Haskerwaul.Functor.Closed.Cartesian
, module Haskerwaul.Functor.Monoidal.Closed
) where
import Haskerwaul.Category.Monoidal.Closed.Cartesian
import Haskerwaul.Functor.Monoidal.Closed
class ( CartesianClosedMonoidalCategory... |
8e19a1c0bc311466a82112a1f1b06be2dda22fff5d89b3f29baf4df5e57df796 | erlang/otp | decode_packet_SUITE.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2022 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/erlang/otp/de5bb49320db22159de52e677c5f7499b763b0cd/erts/emulator/test/decode_packet_SUITE.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 2008 - 2022 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
Test suite for erlang : decode_packet/3
-module(decode_packet_SUITE).
-include_lib("common_test/include/ct.hrl")... |
2cd88e591f8b8b6ce76a53366c411019f365e6a629776d0811f192f596792ec1 | ocaml-ppx/ocaml-migrate-parsetree | ast_407.ml | (**************************************************************************)
(* *)
(* OCaml Migrate Parsetree *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-ppx/ocaml-migrate-parsetree/4a05cf7a00d84e5f827cc9ae9c75e5dc85126085/src/ast_407.ml | ocaml | ************************************************************************
OCaml Migrate Parsetree
... | , Facebook
and , Europe
, projet Cristal , INRIA Rocquencourt
, LexiFi
, projet Cristal , INRIA Rocquencourt
Copyright 2018 Institu... |
3cf23c916a356e02cb982b45280e0a7a08f1fff8134a5e6c0e9cc19804963012 | skanev/playground | 15-tests.scm | (require rackunit rackunit/text-ui)
(load-relative "../../support/eopl.scm")
(load-relative "../15.scm")
(define eopl-2.15-tests
(test-suite
"Tests for EOPL exercise 2.15"
(check-true (var-exp? (var-exp 'a)))
(check-equal? (var-exp->var (var-exp 'a)) 'a)
(check-true (lambda-exp? (lambda-exp 'a (var... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/eopl/02/tests/15-tests.scm | scheme | (require rackunit rackunit/text-ui)
(load-relative "../../support/eopl.scm")
(load-relative "../15.scm")
(define eopl-2.15-tests
(test-suite
"Tests for EOPL exercise 2.15"
(check-true (var-exp? (var-exp 'a)))
(check-equal? (var-exp->var (var-exp 'a)) 'a)
(check-true (lambda-exp? (lambda-exp 'a (var... | |
57645fd29f7ea93d58a2f6897683369e4de8746b779f4e874cc2d7713864b16f | sebastianbenz/clojure-game-of-life | field.clj | (ns simulator.field
(:require [clojure.set :as set])
(:import
(javax.swing JFrame JPanel Timer)
(java.awt Color)
(java.awt.event ActionListener )
(java.awt Dimension)))
(defn draw-grid
[g columns rows position]
(do
(.setColor g Color/GRAY)
(doall (map #(.drawLine g (position %1) 0 (p... | null | https://raw.githubusercontent.com/sebastianbenz/clojure-game-of-life/b48c9d8c04d1699dd1e44a6684120b64ce8773ac/src/simulator/field.clj | clojure | (ns simulator.field
(:require [clojure.set :as set])
(:import
(javax.swing JFrame JPanel Timer)
(java.awt Color)
(java.awt.event ActionListener )
(java.awt Dimension)))
(defn draw-grid
[g columns rows position]
(do
(.setColor g Color/GRAY)
(doall (map #(.drawLine g (position %1) 0 (p... | |
c0f189187252bee1e536cecf174ac2eb4706cb9f010d2515582665640cbc6145 | theodormoroianu/SecondYearCourses | HaskellChurch_20210415162754.hs | {-# LANGUAGE RankNTypes #-}
module HaskellChurch where
A boolean is any way to choose between two alternatives
newtype CBool = CBool {cIf :: forall t. t -> t -> t}
An instance to show as regular Booleans
instance Show CBool where
show b = show $ cIf b True False
The boolean constant true always chooses the ... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/5e359e6a7cf588a527d27209bf53b4ce6b8d5e83/FLP/Laboratoare/Lab%209/.history/HaskellChurch_20210415162754.hs | haskell | # LANGUAGE RankNTypes #
The boolean negation switches the alternatives
The boolean conjunction can be built as a conditional
The boolean disjunction can be built as a conditional
a pair is a way to compute something based on the values
contained within the pair.
a function to be applied on the values, it will apply i... | module HaskellChurch where
A boolean is any way to choose between two alternatives
newtype CBool = CBool {cIf :: forall t. t -> t -> t}
An instance to show as regular Booleans
instance Show CBool where
show b = show $ cIf b True False
The boolean constant true always chooses the first alternative
cTrue :: C... |
92ed759f0607be900b7f782dca8ccc14e185ef04480aa7fd6e2aadf6fc1b05ad | softwarelanguageslab/maf | side-effecting-function.scm | ; Tainted flow from a2 to b2.
(define a #t)
(define a2 (source a))
(define b #t)
(define (set-b) (set! b 10))
(if a2 (set-b))
(define b2 (sink b)) | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/241c1fadb24aa545af9b8a93670f9043ef15c1d3/test/taint/side-effecting-function.scm | scheme | Tainted flow from a2 to b2. | (define a #t)
(define a2 (source a))
(define b #t)
(define (set-b) (set! b 10))
(if a2 (set-b))
(define b2 (sink b)) |
47e7be368b270d200f886f05b1e34c73fc9a246fb0fc02e23983254c9dd2af44 | racketscript/racketscript | case-lambda.rkt | #lang racket/base
(define lam1
(case-lambda
[(a b c) (* a b c)]
[(a b) (+ a b)]))
(displayln (list (lam1 8 2 3) (* 8 2 3)))
(displayln (list (lam1 3 4) (+ 3 4)))
( check - exn exn : fail ? ( λ ( ) ( lam1 3 4 5 6 ) ) " no matching clause " )
(define lam2
(case-lambda
[() "duh"]
[(a b c) (* a b c)]... | null | https://raw.githubusercontent.com/racketscript/racketscript/f94006d11338a674ae10f6bd83fc53e6806d07d8/tests/basic/case-lambda.rkt | racket | #lang racket/base
(define lam1
(case-lambda
[(a b c) (* a b c)]
[(a b) (+ a b)]))
(displayln (list (lam1 8 2 3) (* 8 2 3)))
(displayln (list (lam1 3 4) (+ 3 4)))
( check - exn exn : fail ? ( λ ( ) ( lam1 3 4 5 6 ) ) " no matching clause " )
(define lam2
(case-lambda
[() "duh"]
[(a b c) (* a b c)]... | |
0ed0cc8f8ba360159e4d1bb85fc01d785fda374ad1c950bb0353e8d8f5e5cbb1 | nebularis/systest | systest_supervision_cth.erl | -*- tab - width : 4;erlang - indent - level : 4;indent - tabs - mode : nil -*-
%% ex: ts=4 sw=4 et
%% ----------------------------------------------------------------------------
%%
Copyright ( c ) 2005 - 2012 Nebularis .
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of this ... | null | https://raw.githubusercontent.com/nebularis/systest/fbef181fd0203137f9f6ca6a471c75ca180ec375/test/systest_supervision_cth.erl | erlang | ex: ts=4 sw=4 et
----------------------------------------------------------------------------
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), deal
to use, copy, modify, merge, publish, distribute, sublicense, and/o... | -*- tab - width : 4;erlang - indent - level : 4;indent - tabs - mode : nil -*-
Copyright ( c ) 2005 - 2012 Nebularis .
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the ... |
6cbefa6306c403abdf88d738c2ee8c861cf1c8b1a164fe40416c58bfdec7d967 | bufferswap/ViralityEngine | transform-protocol.lisp | (in-package #:virality)
;;; NOTE: Each user protocol function below is generic for maximum flexibility.
They can take 1 of 3 objects to operate on :
1 . A transform component to directly manipulate .
2 . An actor object , since it is assumed that actor transforms are permanent
;;; once the flows add one to an ac... | null | https://raw.githubusercontent.com/bufferswap/ViralityEngine/df7bb4dffaecdcb6fdcbfa618031a5e1f85f4002/src/core-late/transform-protocol.lisp | lisp | NOTE: Each user protocol function below is generic for maximum flexibility.
once the flows add one to an actor.
actor's transform component. In the case of a "floating" component with no
actor, a runtime error is caught to prevent unintutive late errors.
This flexibility will allow for less mistakes and also clean... | (in-package #:virality)
They can take 1 of 3 objects to operate on :
1 . A transform component to directly manipulate .
2 . An actor object , since it is assumed that actor transforms are permanent
3 . Any arbitrary component , in which case an attempt is made to access it 's
(defgeneric get-model-matrix (ob... |
29015a443401a6e5f60d57520c93fb7df4c6ca9a65c1d1c39a37d4c0858ee54e | BU-CS320/Fall-2018 | InfiniteLists.hs | module InfiniteLists where
Problem One : Infinite lists and lazy evaluation .
This question consists of a " prequestion " with multiple parts
asking you to think about , predict , and then verify the
result of various operations on infinite lists ( no credit , but
skip it at your per... | null | https://raw.githubusercontent.com/BU-CS320/Fall-2018/beec3ca88be5c5a62271a45c8053fb1b092e0af1/assignments/week6/hw/src/InfiniteLists.hs | haskell | (i )
(ii )
(iii )
(v )
(vii )
(viii )
(ix )
(x )
(xi )
(xii )
(xiii )
(xiv )
(xv )
(xvi )
(xvii )
(xviii )
(xix1
(xx )
(i)
(ii)
(iii)
(iv)
(v)
(vi)
(vii)
(viii)
(ix)
(x)
(xi)
(xii)
(xiii)
(xiv)
(xv)
(xvi)
(xvii)
(xviii)
(xix1
(xx)
helper functions or multiple ca... | module InfiniteLists where
Problem One : Infinite lists and lazy evaluation .
This question consists of a " prequestion " with multiple parts
asking you to think about , predict , and then verify the
result of various operations on infinite lists ( no credit , but
skip it at your per... |
af23ad139cb326784cfab9c3bb676ce952222874eb399ddc150dadce2434341c | ff-notes/ron | Backend.hs | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
-- | RON Storage details. Use of this module only to implement a backend.
module RON.Stora... | null | https://raw.githubusercontent.com/ff-notes/ron/0df2b7985996ecc498808ea7247d0d8de471da4f/ron-storage/lib/RON/Storage/Backend.hs | haskell | # LANGUAGE OverloadedStrings #
| RON Storage details. Use of this module only to implement a backend.
| Document version identifier (file name)
| Document identifier (directory name),
should be a RON-Base32-encoded RON-UUID.
| Collection (directory name)
| A type that intended to be put in a separate collection m... | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module RON.Storage.Backend
( Collection (..),
CollectionName,
DocId (..),
Document (..),
DocVersion,
Is... |
a1692d7519d406f7f7337a04240910a9013914944d1ac1e8662670b434cdd9e6 | amosr/folderol | Name.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE TemplateHaskell #
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
module Folderol.Typed.Name (
Channel(..)
) where
import qualified Folderol.Untyped.Name as U
import P
newtype Channel a = UnsafeChannel { unChannel :: U.Chan... | null | https://raw.githubusercontent.com/amosr/folderol/9b8c0cd30cfb798dadaa404cc66404765b1fc4fe/src/Folderol/Typed/Name.hs | haskell | # LANGUAGE NoImplicitPrelude #
# LANGUAGE TemplateHaskell #
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
module Folderol.Typed.Name (
Channel(..)
) where
import qualified Folderol.Untyped.Name as U
import P
newtype Channel a = UnsafeChannel { unChannel :: U.Chan... | |
1425a110fc5d667ac71acfe9474b3659f6bc5bedd71f86d04935e46fcc0bdaa0 | karamellpelle/grid | ShadeScenePause.hs | grid is a game written in Haskell
Copyright ( C ) 2018
--
-- This file is part of grid.
--
-- grid is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
-- (at your optio... | null | https://raw.githubusercontent.com/karamellpelle/grid/56729e63ed6404fd6cfd6d11e73fa358f03c386f/source/Game/Run/Scene/Plain/ShadeScenePause.hs | haskell |
This file is part of grid.
grid is free software: you can redistribute it and/or modify
(at your option) any later version.
grid 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 PARTICULAR PURPOSE. See the
GN... | grid is a game written in Haskell
Copyright ( C ) 2018
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
module Game.Run.Scene.Plain.ShadeScenePause
(
... |
b02d0282664bda8b41d8b6cd2b52e402a8e17f49e48c6dfa7c27c379c77d43dc | nilenso/time-tracker | core.clj | (ns time-tracker.invoices.core
(:require [time-tracker.timers.core :as timers-core]
[clojure.algo.generic.functor :refer [fmap]]
[time-tracker.util :as util]
[time-tracker.config :as config]
[clj-pdf.core :as clj-pdf]
[clj-time.core :as time]
[cl... | null | https://raw.githubusercontent.com/nilenso/time-tracker/054d0dc6d6b89a4ed234d8f0b0a260b6deeef9e3/src/clj/time_tracker/invoices/core.clj | clojure | TODO: Map these to their symbols and render ₹ properly
`end` is exclusive, but the to-date must be inclusive.
Nilenso + Client information
clj/pdf will fail to load PDFs created if fields are null
so whichever fields can possibly be null
should be set as an empty string
Staffing + Rates
Total amount + Tax infor... | (ns time-tracker.invoices.core
(:require [time-tracker.timers.core :as timers-core]
[clojure.algo.generic.functor :refer [fmap]]
[time-tracker.util :as util]
[time-tracker.config :as config]
[clj-pdf.core :as clj-pdf]
[clj-time.core :as time]
[cl... |
930adb2ebc2babf2400ab9056ff48ef3c4730188a67eb3fd6dc16b10930078bf | janestreet/merlin-jst | lazy_backtrack.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
(* ... | null | https://raw.githubusercontent.com/janestreet/merlin-jst/980b574405617fa0dfb0b79a84a66536b46cd71b/upstream/ocaml_413/utils/lazy_backtrack.ml | ocaml | ************************************************************************
OCaml
Fabrice L... | Copyright 2012 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
type ('a,'b) t = ('a,'b) eval ref
and ('a,'b) eval =
| Done of 'b
| Raise of exn
| Thunk of 'a
type undo =
| Nil
| Cons : ('a, 'b) t * 'a * undo -> undo
type... |
dfa63097edc0923b2b9e94fe8223f0657434331d6f5a5226606bea7410b5310f | Gbury/dolmen | stmt.ml |
(* This file is free software, part of dolmen. See file "LICENSE" for more information *)
(** Interfaces for statements.
This module defines interfaces for statements, i.e top-level
declarations in files. *)
module type Response = sig
* Signature used by the Response class , which parses prover responses , ... | null | https://raw.githubusercontent.com/Gbury/dolmen/30acfc9d8751fdf88b9288943aaa3481fc7254a6/src/interface/stmt.ml | ocaml | This file is free software, part of dolmen. See file "LICENSE" for more information
* Interfaces for statements.
This module defines interfaces for statements, i.e top-level
declarations in files.
* The type of statements.
* The type of identifiers.
* The type of terms.
* The type of locations.
* {2 Erro... |
module type Response = sig
* Signature used by the Response class , which parses prover responses ,
i.e. SAT / UNSAT answers ( with option certificates ) .
i.e. SAT/UNSAT answers (with option certificates). *)
type t
type id
type term
type location
val error : ?loc:location -> string ... |
8ff7b7e5d80d9be27864df646d014e32186b3c0c8ce9e4a79069f54f4d46609d | faylang/fay | infixDataConst.hs | module InfixDataConst where
data Ty1 = Integer `InfixConst1` Integer
data Ty2 = Bool `InfixConst2` Bool
data Ty3 = Ty1 :=> Ty2
t = (123 `InfixConst1` 123) :=> (False `InfixConst2` True)
main = print t
| null | https://raw.githubusercontent.com/faylang/fay/8455d975f9f0db2ecc922410e43e484fbd134699/tests/infixDataConst.hs | haskell | module InfixDataConst where
data Ty1 = Integer `InfixConst1` Integer
data Ty2 = Bool `InfixConst2` Bool
data Ty3 = Ty1 :=> Ty2
t = (123 `InfixConst1` 123) :=> (False `InfixConst2` True)
main = print t
| |
9d31ae80812c409a32e6d2e8b033e8c677a6404a411145f572202234adca3788 | rd--/hsc3 | miRings.help.hs | MiRings ; basics ; 0 = MODAL_RESONATOR
X.miRings ar (impulse ar 1 0) 0 60 0.25 0.5 0.7 0.25 (X.miRings_mode "MODAL_RESONATOR") 1 0 0 0
MiRings ; basics ; 0 = MODAL_RESONATOR ; event control
let f (_,g,x,y,z,o,rx,ry,_,_,_) =
let tr = trig1 g controlDur
md = X.miRings_mode "MODAL_RESONATOR"
in ... | null | https://raw.githubusercontent.com/rd--/hsc3/e1c9377f4985f4cc209a9cb11421bc8f1686c6f2/Help/Ugen/miRings.help.hs | haskell | > spacey ; forceId ' internal exciter '
> drone ; set damp to 1.0 to get a sustaining sound that does n't need to be triggered | MiRings ; basics ; 0 = MODAL_RESONATOR
X.miRings ar (impulse ar 1 0) 0 60 0.25 0.5 0.7 0.25 (X.miRings_mode "MODAL_RESONATOR") 1 0 0 0
MiRings ; basics ; 0 = MODAL_RESONATOR ; event control
let f (_,g,x,y,z,o,rx,ry,_,_,_) =
let tr = trig1 g controlDur
md = X.miRings_mode "MODAL_RESONATOR"
in ... |
e103b590bffbcbeb6510f958caf5964c2e7119b4ddc4b2ed2b27aea2d8bb14f6 | per-gron/blackhole | tree.scm | ;; A functional balanced tree data structure, with a rather low level
;; interface. It is intended to be used as a base to implement data
;; structures like maps, sets and priority queues. It can obviously
;; also be used to implement sorting, removal of duplicate elements in
;; lists and things like that. The implemen... | null | https://raw.githubusercontent.com/per-gron/blackhole/3f78eb726f85a6b8bddf757e6f28c785bc70e53d/src/tree.scm | scheme | A functional balanced tree data structure, with a rather low level
interface. It is intended to be used as a base to implement data
structures like maps, sets and priority queues. It can obviously
also be used to implement sorting, removal of duplicate elements in
lists and things like that. The implementation is ... | its arguments . It might or might not , but other functions
Copyright ( c ) 2010 Per Eckerdal
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 PROVIDE... |
c41b3c799dcb93773aeb87e82dfdcf5c398fc69eb9937511f7654084589daf90 | ILIYANGERMANOV/sense-lang | SStatement.hs | module Data.SStatement where
import Data.Identifier
import Data.SType (SType)
import Data.SVariable (SVariable)
data SCaseStatement = SCaseStatement {scCase :: SCase, scStm :: SStatement}
deriving (Show)
data SStatement
= DeclareVariable {decVar :: SVariable}
| SetState {setId :: Identifier, setVal :: String}
... | null | https://raw.githubusercontent.com/ILIYANGERMANOV/sense-lang/5c47d6c76f89ac02ffa8699b4279102f3267c883/sense-compiler/src/Data/SStatement.hs | haskell | module Data.SStatement where
import Data.Identifier
import Data.SType (SType)
import Data.SVariable (SVariable)
data SCaseStatement = SCaseStatement {scCase :: SCase, scStm :: SStatement}
deriving (Show)
data SStatement
= DeclareVariable {decVar :: SVariable}
| SetState {setId :: Identifier, setVal :: String}
... | |
6d1a04f1e5256b8526c57434aa9fba21cee4f294bd720d13a81a192ad379ea6e | vii/cl-irregsexp | make-html-table.lisp | (in-package :cl-user)
(require 'cl-irregsexp)
(defun slurp-file (name)
(with-open-file (s name)
(let ((buf (make-string (file-length s))))
(read-sequence buf s)
buf)))
(let ((table (make-hash-table :test 'equalp)))
(loop for file in (directory "*.table") do
(cl-irregsexp:match-bind ((* name (+ (... | null | https://raw.githubusercontent.com/vii/cl-irregsexp/cc23512d3fe2880c5df47fa96d47b352c3d5b73a/bench/make-html-table.lisp | lisp | (in-package :cl-user)
(require 'cl-irregsexp)
(defun slurp-file (name)
(with-open-file (s name)
(let ((buf (make-string (file-length s))))
(read-sequence buf s)
buf)))
(let ((table (make-hash-table :test 'equalp)))
(loop for file in (directory "*.table") do
(cl-irregsexp:match-bind ((* name (+ (... | |
a63d60e3cbb3a4a32fc28f7a1bb79e95afe71c4d7d5aea2f3b63e2f68fa094ec | soulomoon/SICP | Exercise4.55.scm | Exercise 4.55 : Give simple queries that retrieve the following information from the data base :
all people supervised by ;
; the names and jobs of all people in the accounting division;
the names and addresses of all people who live in Slumerville .
loading is from " -4-55/ "
; I use iq as interpret-query... | null | https://raw.githubusercontent.com/soulomoon/SICP/1c6cbf5ecf6397eaeb990738a938d48c193af1bb/Chapter4/Exercise4.55.scm | scheme |
the names and jobs of all people in the accounting division;
I use iq as interpret-query.
memory limit : 2048 MB .
'done
> | Exercise 4.55 : Give simple queries that retrieve the following information from the data base :
the names and addresses of all people who live in Slumerville .
loading is from " -4-55/ "
thankx for that I could continue my exercise
(load "/Users/soulomoon/git/SICP/Chapter4/ch4-query.rkt")
(iq '(supervis... |
2aa3cc8ea4a022f1080e52b77e555d8ffd500b8b630c00baaacb0e33dcbf6d15 | TrustInSoft/tis-kernel | ctypes.mli | (**************************************************************************)
(* *)
This file is part of .
(* *)
is a fork of Frama - C. Al... | null | https://raw.githubusercontent.com/TrustInSoft/tis-kernel/748d28baba90c03c0f5f4654d2e7bb47dfbe4e7d/src/plugins/wp/ctypes.mli | ocaml | ************************************************************************
... | This file is part of .
is a fork of Frama - C. All the differences are :
Copyright ( C ) 2016 - 2017
is released under GPLv2
This file is part of WP plug - in of Frama - C.
Copyright ( C ) 2007 - 2015 ... |
2de404f2f40832565454935c5595f152a498f7079291971343cf9c6a1e9b2254 | YoshikuniJujo/funpaala | state2.hs | import Data.Bool (bool)
newtype State s a = State { runState :: s -> (a, s) }
retS :: a -> State s a
retS x = State $ \s -> (x, s)
bindS :: State s a -> (a -> State s b) -> State s b
State m `bindS` f = State $ \s -> let (x, s') = m s in runState (f x) s'
instance Functor (State s) where
fmap f m = m `bindS` (retS... | null | https://raw.githubusercontent.com/YoshikuniJujo/funpaala/5366130826da0e6b1180992dfff94c4a634cda99/samples/37_list_and_monad/state2.hs | haskell | import Data.Bool (bool)
newtype State s a = State { runState :: s -> (a, s) }
retS :: a -> State s a
retS x = State $ \s -> (x, s)
bindS :: State s a -> (a -> State s b) -> State s b
State m `bindS` f = State $ \s -> let (x, s') = m s in runState (f x) s'
instance Functor (State s) where
fmap f m = m `bindS` (retS... | |
4c0e129f8b3c37c603f10c74500a9b2ed49c293f0365a86e4af9e8bb9b9fe164 | ktakashi/scheme-env | tools.scm | -*- mode : scheme ; coding : utf-8 ; -*-
;;;
;;; tools.scm - Scheme environment tools
;;;
Copyright ( c ) 2018 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; 1. Redist... | null | https://raw.githubusercontent.com/ktakashi/scheme-env/a8a670dbe39bb3bd271ff431ea69669deab0d12a/lib/tools.scm | scheme | coding : utf-8 ; -*-
tools.scm - Scheme environment tools
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of ... | Copyright ( c ) 2018 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
#!read-macro=sagittarius/regex
#!nounbound
(library... |
6267f3a447ad8a015694e03de7b755c0920eb9e243223a6e8e8e2357c9738136 | NalaGinrut/artanis | controller.scm | -*- indent - tabs - mode : nil ; coding : utf-8 -*-
Copyright ( C ) 2015,2016,2017
" Mu Lei " known as " NalaGinrut " < >
Artanis is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License and GNU
Lesser General Public License published by the ... | null | https://raw.githubusercontent.com/NalaGinrut/artanis/3412d6eb5b46fde71b0965598ba085bacc2a6c12/artanis/mvc/controller.scm | scheme | coding : utf-8 -*-
any later version.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License and GNU Lesser General Public License
for more details.
and GNU Lesser General Public License along with this program... | Copyright ( C ) 2015,2016,2017
" Mu Lei " known as " NalaGinrut " < >
Artanis is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License and GNU
Lesser General Public License published by the Free Software
Foundation , either version 3 of the Lic... |
4b18bb83de1d70f7a9eb434fc5cd4afa8c47b69a37639c8a8e53d23cd5c5c046 | cljfx/cljfx | context_test.clj | (ns cljfx.context-test
(:require [clojure.test :refer :all]
[testit.core :refer :all]
[cljfx.context :as context]))
(deftest context-allows-subscriptions-to-call-each-other
(let [context (context/create {:db 1} identity)
inc-db #(inc (context/sub-val % :db))]
(fact
(contex... | null | https://raw.githubusercontent.com/cljfx/cljfx/ec3c34e619b2408026b9f2e2ff8665bebf70bf56/test/cljfx/context_test.clj | clojure | Dirty dependents should update
their key deps, regardless if they need a full recalculation. | (ns cljfx.context-test
(:require [clojure.test :refer :all]
[testit.core :refer :all]
[cljfx.context :as context]))
(deftest context-allows-subscriptions-to-call-each-other
(let [context (context/create {:db 1} identity)
inc-db #(inc (context/sub-val % :db))]
(fact
(contex... |
3ed1758a9ccf03844c7e030313d69da7f6aaa08ecf11e2c02ba3424bd1a04e10 | FlowerWrong/mblog | chat_socket.erl | %% ---
Excerpted from " Programming Erlang , Second Edition " ,
published by The Pragmatic Bookshelf .
%% Copyrights apply to this code. It may not be used to create training material,
%% courses, books, articles, and the like. Contact us if you are in doubt.
%% We make no guarantees that this code is fit for... | null | https://raw.githubusercontent.com/FlowerWrong/mblog/3233ede938d2019a7b57391405197ac19c805b27/categories/erlang/demo/jaerlang2_code/chat_socket.erl | erlang | ---
Copyrights apply to this code. It may not be used to create training material,
courses, books, articles, and the like. Contact us if you are in doubt.
We make no guarantees that this code is fit for any purpose.
Visit for more book information.
---
server:
client:
"fred" is who I am
... | Excerpted from " Programming Erlang , Second Edition " ,
published by The Pragmatic Bookshelf .
-module(chat_socket).
-compile(export_all).
chat_socket : start_chat_server("joe " , " 123 " ) .
" " is who I am
chat_socket : call("localhost","fred " , " 123 " ) .
start_chat_server(Who, Secret)... |
d660891b5bb1382f19c4508500027b0cf57c3888b7455d4a628f2fe3c3397184 | siers/zn | Store.hs | {-# LANGUAGE OverloadedStrings #-}
module Zn.Commands.URL.Store
( storeName
, storePrefix
, store
) where
import Control.Lens
import Control.Monad.IO.Class
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Lazy as BL
import Data.Maybe
import Data.Text (Text, unpack)
import Da... | null | https://raw.githubusercontent.com/siers/zn/b78692910fc5c4c725b3133cb91f5e1e3da94808/src/Zn/Commands/URL/Store.hs | haskell | # LANGUAGE OverloadedStrings #
both branches are distinguishable via regex | module Zn.Commands.URL.Store
( storeName
, storePrefix
, store
) where
import Control.Lens
import Control.Monad.IO.Class
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Lazy as BL
import Data.Maybe
import Data.Text (Text, unpack)
import Data.UnixTime
import Network.IRC.Clie... |
7b1fa22b804194412efe9f0ffeda5a171b46b8049ae8b02e29cff17ac9ce56f5 | haskell/cabal | setup.test.hs | import Test.Cabal.Prelude
-- Test that Paths module is generated and available for libraries.
main = setupAndCabalTest $ setup_build []
| null | https://raw.githubusercontent.com/haskell/cabal/ffa9f01b3bf0eccf2318bdd3e644ccc175b8a0e0/cabal-testsuite/PackageTests/PackageInfoModule/Library/setup.test.hs | haskell | Test that Paths module is generated and available for libraries. | import Test.Cabal.Prelude
main = setupAndCabalTest $ setup_build []
|
37b870c30731f9f0b3ff023c05dbf9ea83d89058d8665a753bb2e8636144456a | wireless-net/erlang-nommu | ssh_system_sup.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2013 . All Rights Reserved .
%%
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 Publi... | null | https://raw.githubusercontent.com/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/ssh/src/ssh_system_sup.erl | erlang |
%CopyrightBegin%
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 online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitatio... | Copyright Ericsson AB 2008 - 2013 . All Rights Reserved .
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 "
Purpose : The ssh server instance superv... |
c12fc89da8d68bbc4e81fdf22051a68ee5117a2780d3f940e4f753faf1cd46d9 | caisah/sicp-exercises-and-examples | ex_2.61.scm | ;; Give an implementation of adjoin-set using the ordered representation. By analogy with
;; element-of-set? show how to take advantage of the ordering to produce a procedure that
requires on the average about half as many steps as with the unordered representation .
(define (adjoin-set x set)
(cond ((null? set) (... | null | https://raw.githubusercontent.com/caisah/sicp-exercises-and-examples/605c698d7495aa3474c2b6edcd1312cb16c5b5cb/2.3.3-representing_sets/ex_2.61.scm | scheme | Give an implementation of adjoin-set using the ordered representation. By analogy with
element-of-set? show how to take advantage of the ordering to produce a procedure that | requires on the average about half as many steps as with the unordered representation .
(define (adjoin-set x set)
(cond ((null? set) (append set (list x)))
((= x (car set)) set)
((< x (car set)) (cons x set))
(else (cons (car set) (adjoin-set x (cdr set))))))
(adjoin-set 4 (list 2 3 5 6 8... |
09fc77fd5464578656868731d011d4153a1790d3ee8ed5e2cf32bc7069ba2285 | yansh/MoanaML | helper.ml |
* Copyright ( c ) 2015
* 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 .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS... | null | https://raw.githubusercontent.com/yansh/MoanaML/c9843c10a0624e1c06e185e3dd1e7d877270d0d7/helper.ml | ocaml | * tuple object to string *
FIX ME: Need to take care of Context, Signature and Timestamp
create tuple from JSON
FIX ME: Need to take care of Context, Signature and Timestamp
helper function for printing out (variable, values) pairs
* convert string to list of tuple objects *
* gen tuples from a file *
* string ... |
* Copyright ( c ) 2015
* 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 .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS... |
8c38ff70f62c000e57add03191139203635c967600e9b4e7d81dc287d766adef | Kaleb47/Haskell-Plutus-journal | thinkingrecursively.hs | -- what are recursive functions?
--a function defined in terms of itself
--why are recursive functions useful?
many functions inHaskell have recursive definitions , also you ca n't do loops .
--if you write your functions rrecursively, you can use induction which excellent for mathematical reasoning
--why are recursi... | null | https://raw.githubusercontent.com/Kaleb47/Haskell-Plutus-journal/0a6bff041fa5e7330e17bc2c7bc8bc22f2eacc75/thinkingrecursively.hs | haskell | what are recursive functions?
a function defined in terms of itself
why are recursive functions useful?
if you write your functions rrecursively, you can use induction which excellent for mathematical reasoning
why are recursive functions difficult?
its very different from other imperative languages. no loops
Define a... |
many functions inHaskell have recursive definitions , also you ca n't do loops .
Stage 3 : Enumerate the cases for the function
Stage 4 : Define the simple cases for the function .
Sum : : [ Int ] - > Int
Sum [ ] = 0
Sum ( x : xs ) =
by definition , to find the sum of the empty list , the rright base ... |
77d4cbc1413fdea74804dc1d9528526ef1243ea0cc1d1d8b255d1ed0e3ac38c9 | mjambon/mikmatch | mm_util.ml | pp camlp4orf
$ Id$
open Camlp4.PreCast
open Messages
General utilities
let debug s =
if !Constants.debug_mode then
Printf.eprintf "[debug] %s\n%!" s
let list_of_comma_expr e =
let rec aux e l =
match e with
<:expr< $e1$ , $e2$ >> -> aux e1 (aux e2 l)
| <:expr< >> -> l
| e -> e :: l... | null | https://raw.githubusercontent.com/mjambon/mikmatch/4ee0d1158370be247763027018bbf54b865014dd/common/mm_util.ml | ocaml | pp camlp4orf
$ Id$
open Camlp4.PreCast
open Messages
General utilities
let debug s =
if !Constants.debug_mode then
Printf.eprintf "[debug] %s\n%!" s
let list_of_comma_expr e =
let rec aux e l =
match e with
<:expr< $e1$ , $e2$ >> -> aux e1 (aux e2 l)
| <:expr< >> -> l
| e -> e :: l... | |
2045502240792a13a7dac5b75390afb3eff2684922a001311f89a072819bbccb | rescript-lang/rescript-compiler | lam_iter.mli | Copyright ( C ) 2018 - Hongbo Zhang , Authors of ReScript
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) an... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/e60482c6f6a69994907b9bd56e58ce87052e3659/jscomp/core/lam_iter.mli | ocaml | Copyright ( C ) 2018 - Hongbo Zhang , Authors of ReScript
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) an... | |
1a77b95716a194fb625ad4532703e132d62e387c5fefb043055688b4452f3c50 | inhabitedtype/ocaml-aws | labelParameterVersion.ml | open Types
open Aws
type input = LabelParameterVersionRequest.t
type output = LabelParameterVersionResult.t
type error = Errors_internal.t
let service = "ssm"
let signature_version = Request.V4
let to_http service region req =
let uri =
Uri.add_query_params
(Uri.of_string (Aws.Util.of_option_exn (Endp... | null | https://raw.githubusercontent.com/inhabitedtype/ocaml-aws/3bc554af7ae7ef9e2dcea44a1b72c9e687435fa9/libraries/ssm/lib/labelParameterVersion.ml | ocaml | open Types
open Aws
type input = LabelParameterVersionRequest.t
type output = LabelParameterVersionResult.t
type error = Errors_internal.t
let service = "ssm"
let signature_version = Request.V4
let to_http service region req =
let uri =
Uri.add_query_params
(Uri.of_string (Aws.Util.of_option_exn (Endp... | |
4d98bed5605d8542b350c03bee8dba7894dc6c0c104e1f8711a4ae40fa4b9d9d | damhiya/CircuitSimulator | Circuit.hs | {-#
LANGUAGE
ExistentialQuantification
#-}
module Circuit where
import Expression
import Data.Hashable
type NodeId = Int
type ComponentId = Int
type LeadId = Int
type VariableId = Int
data CircuitVariable = Time
| NodeVoltage NodeId
| ComponentVariable... | null | https://raw.githubusercontent.com/damhiya/CircuitSimulator/df3c3b4fb3b7e6d5517c6c09f881e862f7c4201a/src/Circuit.hs | haskell | #
LANGUAGE
ExistentialQuantification
# |
module Circuit where
import Expression
import Data.Hashable
type NodeId = Int
type ComponentId = Int
type LeadId = Int
type VariableId = Int
data CircuitVariable = Time
| NodeVoltage NodeId
| ComponentVariable ComponentId VariableId
|... |
e6d9dff238257dc868a01d11e3ebf3622a595f0618f03597d3d1a4500240830c | clojure-emacs/cljs-tooling | test_env.cljc | (ns cljs-tooling.test-env
(:require [clojure.test :as test #?(:clj :refer :cljs :refer-macros) [deftest is testing]]
[clojure.set :as set]
[cljs-tooling.util.analysis :as a]
[cljs.env :as env]
#?@(:clj [[cljs.analyzer.api :as ana]
[cljs.build.api :... | null | https://raw.githubusercontent.com/clojure-emacs/cljs-tooling/b5252b65dbf67d5e5f82a544ca1a5a480ecd49b9/test/cljs_tooling/test_env.cljc | clojure | (ns cljs-tooling.test-env
(:require [clojure.test :as test #?(:clj :refer :cljs :refer-macros) [deftest is testing]]
[clojure.set :as set]
[cljs-tooling.util.analysis :as a]
[cljs.env :as env]
#?@(:clj [[cljs.analyzer.api :as ana]
[cljs.build.api :... | |
f557ecd89598f5008a78685a7eeb32677d731ea4251a2b22592609c6dec451b0 | cl21/cl21 | generic.lisp |
(in-package :cl21-user)
(defpackage cl21-test.core.generic
(:use :cl21
:cl-test-more))
(in-package :cl21-test.core.generic)
(plan nil)
(let ((hash (make-hash-table :test 'eq)))
(setf (getf hash :name) "Eitaro Fukamachi")
(is-print (doeach ((key val) hash)
(format t "~A: ~A\n" key val))
... | null | https://raw.githubusercontent.com/cl21/cl21/c36644f3b6ea4975174c8ce72de43a4524dd0696/t/core/generic.lisp | lisp | nonexistent element |
(in-package :cl21-user)
(defpackage cl21-test.core.generic
(:use :cl21
:cl-test-more))
(in-package :cl21-test.core.generic)
(plan nil)
(let ((hash (make-hash-table :test 'eq)))
(setf (getf hash :name) "Eitaro Fukamachi")
(is-print (doeach ((key val) hash)
(format t "~A: ~A\n" key val))
... |
368a4eed111300344921d9088b67fc05a45d41f5a96b8f051c21bf9dd3895392 | composewell/streamly | Common.hs | # OPTIONS_GHC -Wno - deprecations #
-- |
Module : Streamly . Test . FileSystem . Event . Common
Copyright : ( c ) 2020 Composewell Technologies
-- License : BSD-3-Clause
-- Maintainer :
-- Stability : experimental
Portability : GHC
--
module Streamly.Test.FileSystem.Event.Common
( TestDesc
... | null | https://raw.githubusercontent.com/composewell/streamly/8629a0e806f5eea87d23650c540aa04176f25c43/test/Streamly/Test/FileSystem/Event/Common.hs | haskell | |
License : BSD-3-Clause
Maintainer :
Stability : experimental
* Running tests
* Event predicates
* Tests
-----------------------------------------------------------------------------
Check generated events
-----------------------------------------------------------------------------
watch root
watch... | # OPTIONS_GHC -Wno - deprecations #
Module : Streamly . Test . FileSystem . Event . Common
Copyright : ( c ) 2020 Composewell Technologies
Portability : GHC
module Streamly.Test.FileSystem.Event.Common
( TestDesc
, runTests
, WatchRootType (..)
, dirEvent
, fileEvent
, dirCrea... |
08fd37e328d1810cf70723938f0c316625a4d3c511b15ee7af87771502781314 | jeromesimeon/Galax | xquery_ast_util.ml | (***********************************************************************)
(* *)
(* GALAX *)
(* XQuery Engine *)
(* ... | null | https://raw.githubusercontent.com/jeromesimeon/Galax/bc565acf782c140291911d08c1c784c9ac09b432/ast/xquery_ast_util.ml | ocaml | *********************************************************************
GALAX
XQuery Engine
... | Copyright 2001 - 2007 .
$ I d : , v 1.47 2007/09/25 15:12:42 mff Exp $
open Finfo
open Namespace_names
open Namespace_builtin
open Xquery_common_ast
open Xquery_common_ast_util
open Xquery_type_ast
open Xquery_ast
open Error
AST creation functions
let mk... |
eab9cf58c7af19a54f8d5d7344bde8f3723138c5e45796964172c314f74b3345 | avsm/platform | pkg.ml | #!/usr/bin/env ocaml
#use "topfind"
#require "topkg"
open Topkg
let jsoo_test ~cond test =
Pkg.flatten
[ Pkg.test ~run:false ~cond ~auto:false (test ^ ".js");
Pkg.test ~run:false ~cond ~auto:false (test ^ ".html"); ]
let () =
Pkg.describe "react" @@ fun c ->
Ok [ Pkg.mllib "src/react.mllib";
Pk... | null | https://raw.githubusercontent.com/avsm/platform/b254e3c6b60f3c0c09dfdcde92eb1abdc267fa1c/duniverse/react.1.2.1%2Bdune/pkg/pkg.ml | ocaml | jsoo_test ~cond:jsoo "test/js_hisig_test";
jsoo_test ~cond:jsoo "test/js_test"; | #!/usr/bin/env ocaml
#use "topfind"
#require "topkg"
open Topkg
let jsoo_test ~cond test =
Pkg.flatten
[ Pkg.test ~run:false ~cond ~auto:false (test ^ ".js");
Pkg.test ~run:false ~cond ~auto:false (test ^ ".html"); ]
let () =
Pkg.describe "react" @@ fun c ->
Ok [ Pkg.mllib "src/react.mllib";
Pk... |
1add8c32f495a389293fdea1d284f1a6c9bfbb6e7f36fde31832128ca691f0a9 | aleator/CV | Sampling.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
module CV.Sampling where
import CV.Image
import Control.Monad.Primitive
import Control.Monad
import System.Random.MWC
import Foreign.C.Types
import qualified CV.ImageMath as IM
import Data.List(partition)
-- Get a patch around every pixel of given size for... | null | https://raw.githubusercontent.com/aleator/CV/1e2c9116bcaacdf305044c861a1b36d0d8fb71b7/CV/Sampling.hs | haskell | Get a patch around every pixel of given size for which it is
attainable (Enough far from edge)
Get all non-overlapping patches of image
Get Coordinates for overlapping tiles
Get overlapping tiles
get patches of image at `coords`
Make a random selections in IO monad
Discard coords around image borders. Useful f... | # LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
module CV.Sampling where
import CV.Image
import Control.Monad.Primitive
import Control.Monad
import System.Random.MWC
import Foreign.C.Types
import qualified CV.ImageMath as IM
import Data.List(partition)
allPatches size image = [getRegion (x,y) size image... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.