_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 |
|---|---|---|---|---|---|---|---|---|
a231ec56ad4354719da715545daaeae7cc39a77196c777dac955507f108d5072 | jserot/caph | par_aux.ml | (************************************************************************************)
(* *)
(* CAPH *)
(* -bpclermont.fr ... | null | https://raw.githubusercontent.com/jserot/caph/2b3b241f0c32aa4fcaf60d4b8529956cca8aa6b1/compiler/par_aux.ml | ocaml | **********************************************************************************
CAPH
-bpclermont.fr
... |
Copyright 2011 - 2019 . All rights reserved .
This file is distributed under the terms of the Q Public License version 1.0 .
open Location
open Syntax
open Misc
let mk_val_decl desc = ValDecl {val_desc = desc; val_loc = get_current_location(... |
36ea247a0bfb30cadfaa71a9acec55d27c8e07953906984e667b659bf7309e72 | Zulu-Inuoe/clution | ffi.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; indent - tabs - mode : nil ; coding : utf-8 ; show - trailing - whitespace : t -*-
;;;
Copyright ( C ) 2001 , 2003
Copyright ( C ) 2005
" the conditions and ENSURE - SSL - FUNCALL are by . "
;;;
;;; See LICENSE for details.
#+xcvb (module (:depends-on ("pack... | null | https://raw.githubusercontent.com/Zulu-Inuoe/clution/b72f7afe5f770ff68a066184a389c23551863f7f/cl-clution/qlfile-libs/cl%2Bssl-20171227-git/src/ffi.lisp | lisp | Syntax : COMMON - LISP ; indent - tabs - mode : nil ; coding : utf-8 ; show - trailing - whitespace : t -*-
See LICENSE for details.
Global state
Constants
Misc
Function definitions
We don't refer SSLv2_client_method as the default
of the SSL v2 protocol (see
and -plus-ssl/cl-plus-ssl/issues/6)
(cffi... | Copyright ( C ) 2001 , 2003
Copyright ( C ) 2005
" the conditions and ENSURE - SSL - FUNCALL are by . "
#+xcvb (module (:depends-on ("package" "conditions")))
(eval-when (:compile-toplevel)
(declaim
(optimize (speed 3) (space 1) (safety 1) (debug 0) (compilation-speed 0))))
(in-package :cl+ssl)
... |
d1bb03391868e3c2b51f2814f6b5ba47f111c352f3d0a387404f2e7a6342ada2 | bzliu94/cs61a_fa07 | 4.scm | 2019 - 08 - 27
group # 4 -- use FIFO thread selection and expensive alive - based filters -- uses concurrent.scm
; advantages:
; - is mostly self-contained except for use of continuations
; disadvantages:
; - harder to perform manual context switches
- it is slower than groups one and two because even though w... | null | https://raw.githubusercontent.com/bzliu94/cs61a_fa07/12a62689f149ef035a36b326351928928f6e7b5d/01%20-%20homework/hw10/experiments/4.scm | scheme | advantages:
- is mostly self-contained except for use of continuations
disadvantages:
- harder to perform manual context switches
this is due to overhead from thread scheduler
important:
expected value for variable we increment for n = 300 is back to ~155 instead of ~25
notes:
- we have non-intrusive and intru... | 2019 - 08 - 27
group # 4 -- use FIFO thread selection and expensive alive - based filters -- uses concurrent.scm
- we are using continuations to get green threads but do not actually use more than one core
(load "includes/concurrent_modified1.scm")
(load "includes/serial.scm")
(define (listify-process-que... |
2dc9058c7faed4aac74a5f66324f27715fa41a66e82460227e885750040ba5bb | Eonblast/Scalaxis | tester_value_creator.erl | 2010 - 2011 Zuse Institute Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writing, software
d... | null | https://raw.githubusercontent.com/Eonblast/Scalaxis/10287d11428e627dca8c41c818745763b9f7e8d4/test/tester_value_creator.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 gov... | 2010 - 2011 Zuse Institute Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
-module(tester_value_creator).
-author('').
-vsn('$Id$').
-include("unittest.hrl").
-include("tester.hrl").
-expor... |
d52c0d4c3aed9eb3c0c43fd38d3ae7f8e660d61d4f2de926461b9319b5c6369b | pupeno/ninjatools | core.clj | Copyright © 2015 Carousel Apps , Ltd. All rights reserved .
(ns ninjatools.test.db.core
(:require [ninjatools.db.core :as db]
[conman.core :as conman]
[ninjatools.db.migrations :as migrations]
[clojure.test :refer :all]
[clojure.java.jdbc :as jdbc]
[conma... | null | https://raw.githubusercontent.com/pupeno/ninjatools/1b73ff22174b5ec196d514062162b252899c1735/test/clj/ninjatools/test/db/core.clj | clojure | Copyright © 2015 Carousel Apps , Ltd. All rights reserved .
(ns ninjatools.test.db.core
(:require [ninjatools.db.core :as db]
[conman.core :as conman]
[ninjatools.db.migrations :as migrations]
[clojure.test :refer :all]
[clojure.java.jdbc :as jdbc]
[conma... | |
7e19b86bc1fbeff5fff9b7ac3dbf074b326d44199609a87be977f253130bdc7d | ktakashi/sagittarius-scheme | cipher.scm | -*- mode : scheme ; coding : utf-8 ; -*-
;;;
;;; sagittarius/crypto/descriptors/cipher.scm - Cipher descriptor
;;;
Copyright ( c ) 2022 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are me... | null | https://raw.githubusercontent.com/ktakashi/sagittarius-scheme/3924abc3290cd00b710be442c47d69966e6e3dc7/ext/crypto/sagittarius/crypto/descriptors/cipher.scm | scheme | coding : utf-8 ; -*-
sagittarius/crypto/descriptors/cipher.scm - Cipher descriptor
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
... | Copyright ( c ) 2022 < >
" 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
#!nounbound
(library (sagittarius crypto descriptor... |
c49c79da05bcd397b7f03790bceafde0fb1f2fe3ba85c54b2967211b9e1a0660 | input-output-hk/cardano-sl | Bi.hs | # LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
module Test.Pos.Chain.Txp.Bi
( tests
) where
import Universum
import qualified Data.Map as M
import Data.Typeable (typeRep)
import Hedgehog (Gen, Property)
import qualified Hedgehog as H
import qualified Hedgehog... | null | https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/chain/test/Test/Pos/Chain/Txp/Bi.hs | haskell | ------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
----... | # LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
module Test.Pos.Chain.Txp.Bi
( tests
) where
import Universum
import qualified Data.Map as M
import Data.Typeable (typeRep)
import Hedgehog (Gen, Property)
import qualified Hedgehog as H
import qualified Hedgehog... |
eed6c41c4d1ff1990304e64e1b00b950c9b790cbf7ef4be796fcc27740a18ad2 | yuriy-chumak/ol | sexp.scm | todo : remove implicit UTF-8 conversion from parser and move to a separate pass
(define-library (lang sexp)
(export
sexp-parser sexp
;get-sexps ;; greedy* get-sexp
;; string->sexp
;bytevector->sexps
list->sexps
list->number
; parser
number get-number
w... | null | https://raw.githubusercontent.com/yuriy-chumak/ol/513fda61e1f606747f55439be45908e135a6353b/lang/sexp.scm | scheme | get-sexps ;; greedy* get-sexp
string->sexp
bytevector->sexps
parser
testing
fast version of (<= lo x hi))
will not intersect
no ', digits and /
simple symbols (without "/" and "|"), easy case for speedup
full featured symbols (with "|" and "/"), must be used after regex parser
(that may contain "/" and ... | todo : remove implicit UTF-8 conversion from parser and move to a separate pass
(define-library (lang sexp)
(export
sexp-parser sexp
list->sexps
list->number
number get-number
whitespace
whitespace-or-comment
get-sexps
get-padded-sexps
fd->exp-stream
... |
a7914ae93fd18f6c58b54bb662569bc7fe75e71910743bca1693c290ce97d297 | haskell/haskell-language-server | UseConRight.hs | test :: Either a b
test = _
| null | https://raw.githubusercontent.com/haskell/haskell-language-server/f3ad27ba1634871b2240b8cd7de9f31b91a2e502/plugins/hls-tactics-plugin/new/test/golden/UseConRight.hs | haskell | test :: Either a b
test = _
| |
d0e4ffcb21b46211b12db1fceb9262155185de2a7eac93048ddb5109655e9568 | con-kitty/categorifier-c | Main.hs | {-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import Categorifier.C.Generate (writeCFiles)
import F (fCategorified)
-- This generates /tmp/simple_example.c
main :: IO ()
main = writeCFiles "/tmp" "simple_example" fCategorified
| null | https://raw.githubusercontent.com/con-kitty/categorifier-c/8f8c105a3b761c0dbe65654423ea875c3c070372/examples/simple/Main.hs | haskell | # LANGUAGE OverloadedStrings #
This generates /tmp/simple_example.c |
module Main (main) where
import Categorifier.C.Generate (writeCFiles)
import F (fCategorified)
main :: IO ()
main = writeCFiles "/tmp" "simple_example" fCategorified
|
72913088f3bb06b72f30f506944c9f123f166a246c5edebb8f0a98aff71bbca3 | sarabander/p2pu-sicp | 3.15.scm |
(define x (list 'a 'b))
(define z1 (cons x x)) ; '((a b) a b)
;;
z1 ╭ ─ ─ ─ ┬ ─ ─ ─ ╮
;; ────>│ ∘ │ ∘ │
;; ╰─┼─┴─┼─╯
;; │ │
x ╭ ─ V ─ ┬ ─ V ─ ╮ ╭ ─ ─ ─ ┬ ─ ─ ─ ╮
;; ────>│ ∘ │ ∘─┼──>│ ∘ │ ╱ │
;; ╰─┼─┴───╯ ╰─┼─┴───╯
;; │ │
╭ ─ V ─ ╮ ... | null | https://raw.githubusercontent.com/sarabander/p2pu-sicp/fbc49b67dac717da1487629fb2d7a7d86dfdbe32/3.3/3.15.scm | scheme | '((a b) a b)
────>│ ∘ │ ∘ │
╰─┼─┴─┼─╯
│ │
────>│ ∘ │ ∘─┼──>│ ∘ │ ╱ │
╰─┼─┴───╯ ╰─┼─┴───╯
│ │
│ a │ │ b │
╰───╯ ╰───╯
'((a b) a b)
────>│ ∘ │ ∘─┼─────>│ ∘ │ ∘─┼──>│ ∘ │ ╱ │
╰─┼─┴───╯ ╰─┼─┴───╯ ╰─┼─┴───╯
... |
(define x (list 'a 'b))
z1 ╭ ─ ─ ─ ┬ ─ ─ ─ ╮
x ╭ ─ V ─ ┬ ─ V ─ ╮ ╭ ─ ─ ─ ┬ ─ ─ ─ ╮
╭ ─ V ─ ╮ ╮
(define z2
z2 ╭ ─ ─ ─ ┬ ─ ─ ─ ╮ ╭ ─ ─ ─ ┬ ─ ─ ─ ╮ ╭ ─ ─ ─ ┬ ─ ─ ─ ╮
│ ╭ ─ V ─ ╮ ╮
│ ╭ ─ ┼ ─ ┬ ─ ─ ─ ╮ ╭ ... |
e92f8e2a610c835c002261fff85e2820f3300d6cfd93f91b851e4ceac2fb179e | GregorySchwartz/too-many-cells | Types.hs | TooManyCells . Motifs . Types
Collects the motif types used in the program .
Gregory W. Schwartz
Collects the motif types used in the program.
-}
{-# LANGUAGE StrictData #-}
module TooManyCells.Motifs.Types where
-- Remote
import qualified Data.Text as T
import qualified Turtle as TU
-- Local
-- Basic... | null | https://raw.githubusercontent.com/GregorySchwartz/too-many-cells/0de948c6e99a489f1d2e8c412a04e4bcf3b26806/src/TooManyCells/Motifs/Types.hs | haskell | # LANGUAGE StrictData #
Remote
Local
Basic | TooManyCells . Motifs . Types
Collects the motif types used in the program .
Gregory W. Schwartz
Collects the motif types used in the program.
-}
module TooManyCells.Motifs.Types where
import qualified Data.Text as T
import qualified Turtle as TU
newtype DiffFile = DiffFile { unDiffFile :: TU.FilePat... |
542db5b13b58131dc9217c45fc5bf6ead6a2c37c370cfdaec8397cef94c1d9c2 | alesaccoia/festival_flinger | oaldlex.scm | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ;;
Centre for Speech Technology Research ; ;
University of Edinburgh , UK ; ;
... | null | https://raw.githubusercontent.com/alesaccoia/festival_flinger/87345aad3a3230751a8ff479f74ba1676217accd/lib/dicts/oald/oaldlex.scm | scheme |
;;
;
;
;
;
;;
Permission is hereby granted, free of charge, to use and distribute ;;
this software and its documentation without restriction, including ;;
without l... | Definition of Festival lexicon , derived from Oxford Advanced
Learners ' Dictionary of Contemporary English
NOTE : is free for non - commercial use only
Using the trained LTS model we have managed to remove 39451 ( out
of 70646 ( 55.84 % ) ) that can be properly predicted by the
(defvar oaldlexdir (pat... |
b0302bb94e344d09ba8972ad9791f1a2ee66954bfb4971a6f541c9fa3c5782f6 | Helium4Haskell/helium | Thompson03.hs | maxFour :: Int -> Int -> Int -> Int -> Int
maxFour
| a >= b && a >= c && a >= d = a
| b >= c && b >= d = b
| c >= d = c
| otherwise = d
| null | https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/test/thompson/Thompson03.hs | haskell | maxFour :: Int -> Int -> Int -> Int -> Int
maxFour
| a >= b && a >= c && a >= d = a
| b >= c && b >= d = b
| c >= d = c
| otherwise = d
| |
c23988b416a52c068ed0d44ce5d21cb75578c27efaae334c59442c666a858760 | ollef/sixten | SourceLoc.hs | {-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE DeriveGeneric #
module SourceLoc where
import Protolude hiding (TypeError)
import Text.Parsix.Highlight
import Text.Parsix.Position
import Pretty
import Syntax.QName
import Util
data SourceLoc
= Absolute !AbsoluteSourceLoc
| Relative ... | null | https://raw.githubusercontent.com/ollef/sixten/60d46eee20abd62599badea85774a9365c81af45/src/SourceLoc.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE OverloadedStrings #
| Gives a summary (fileName:row:column) of the location | # LANGUAGE DeriveGeneric #
module SourceLoc where
import Protolude hiding (TypeError)
import Text.Parsix.Highlight
import Text.Parsix.Position
import Pretty
import Syntax.QName
import Util
data SourceLoc
= Absolute !AbsoluteSourceLoc
| Relative !RelativeSourceLoc
deriving (Eq, Ord, Show, Generic, Hashable)
n... |
0c1437a2cb5ee7b875fd9a1f3ae5adb15ace93ad0976715b5a70cee246316d18 | ghcjs/ghcjs-dom | BiquadFilterNode.hs | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
module GHCJS.DOM.JSFFI.Generated.BiquadFilterNode
(js_getFrequencyResponse, getFrequencyResponse, js_setType,
se... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-dom/749963557d878d866be2d0184079836f367dd0ea/ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/BiquadFilterNode.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #
| <-US/docs/Web/API/BiquadFilterNode.getFrequencyResponse Mozilla BiquadFilterNode.getFrequencyResponse documentation>
| <-US/docs/Web/API/BiquadFilterNode.type Mozilla BiquadFilterNode.type documentation>
| <-US/docs/Web/... | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
module GHCJS.DOM.JSFFI.Generated.BiquadFilterNode
(js_getFrequencyResponse, getFrequencyResponse, js_setType,
setType, js_getType, getType, js_getFrequency, getFrequency,
js_getDetune, getDetune, js_getQ... |
7b8dfd5f0b8cf1a8e19d5c9fda4bb9a57d4444536a32a1ae242f0bbc7184242b | fulcrologic/fulcro-rad-kvstore | seed.cljc | (ns com.example.components.seed
(:require
[com.fulcrologic.guardrails.core :refer [>defn => ?]]
[com.fulcrologic.rad.type-support.decimal :as math]
[com.fulcrologic.rad.ids :refer [new-uuid]]
[com.fulcrologic.rad.attributes :as attr]
[com.fulcrologic.rad.database-adapters.key-value.write :as kv-wr... | null | https://raw.githubusercontent.com/fulcrologic/fulcro-rad-kvstore/f0046c21e386214b42d4621b33dcb3aa1058ad52/src/demo-project/com/example/components/seed.cljc | clojure | Have to use value-of b/c this address doesn't exist elsewhere | (ns com.example.components.seed
(:require
[com.fulcrologic.guardrails.core :refer [>defn => ?]]
[com.fulcrologic.rad.type-support.decimal :as math]
[com.fulcrologic.rad.ids :refer [new-uuid]]
[com.fulcrologic.rad.attributes :as attr]
[com.fulcrologic.rad.database-adapters.key-value.write :as kv-wr... |
98ef67426c89043010eff1e95cae2e3970e3524c04a585f74482bab8a4665d71 | Frechmatz/cl-synthesizer | test-midi-polyphonic-interface.lisp | (in-package :cl-synthesizer-test)
;;
Midi - Interface
;;
(defun test-polyphonic-midi-interface-make-midi-interface
(voice-count
&key
(channel nil))
(cl-synthesizer-modules-midi-polyphonic-interface:make-module
"Test-Midi-Interface"
(cl-synthesizer:make-environment)
:voice-count voice-co... | null | https://raw.githubusercontent.com/Frechmatz/cl-synthesizer/48b0a129854110a3a685ef3d9f8b65b5814c90c3/test/modules/midi/test-midi-polyphonic-interface.lisp | lisp |
tests for update with multiple midi-events
Test channel support
is stolen in polyphonic mode
initial gate must not be nil
initial gate must not be nil | (in-package :cl-synthesizer-test)
Midi - Interface
(defun test-polyphonic-midi-interface-make-midi-interface
(voice-count
&key
(channel nil))
(cl-synthesizer-modules-midi-polyphonic-interface:make-module
"Test-Midi-Interface"
(cl-synthesizer:make-environment)
:voice-count voice-count
... |
e0ab43e9549f3366f93224068882454115d76cbc11e95c5d60785eebce7d97dd | hidaris/thinking-dumps | 42.rkt | #lang racket
42
| null | https://raw.githubusercontent.com/hidaris/thinking-dumps/3fceaf9e6195ab99c8315749814a7377ef8baf86/compiler/abscond/42.rkt | racket | #lang racket
42
| |
10c2317e60626841b75e8bcf39a25e3a6ef0ef4aef7baa5ba8550c7dd2b64a5a | vollmerm/lalla-chess | board.lisp | board.lisp
;;;;
;;;; This file contains functions for manipulating the board.
(in-package #:lalla)
(declaim (optimize speed))
Upper - right corner of the board ( A8 ) is index 0 , so black pieces
;; are inserted at the beginning of the array and white at the end.
;; Downward moving pieces increase in index, and u... | null | https://raw.githubusercontent.com/vollmerm/lalla-chess/62e4068eba7f3288c6e99a7977bd0cc4f4f4190b/board.lisp | lisp |
This file contains functions for manipulating the board.
are inserted at the beginning of the array and white at the end.
Downward moving pieces increase in index, and upward moving pieced
decrease in index.
black pieces
white pieces
These global values represent part of the state of the board.
If board-ep... | board.lisp
(in-package #:lalla)
(declaim (optimize speed))
Upper - right corner of the board ( A8 ) is index 0 , so black pieces
(defparameter initial-positions
#(13 11 12 14 15 12 11 13
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
0 0 0 ... |
7c7e881a42387c030a31270e02c45f4c19a460b0119b5e658401161f66fde12e | pepeiborra/term | Variant.hs | # LANGUAGE CPP #
# LANGUAGE StandaloneDeriving #
# LANGUAGE UndecidableInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
# LANGUAGE GeneralizedNewtypeDeriving #
module Control.Monad.Variant (
Rename(..),
MonadVariant(..),
MVariantT(..), runVariantT, runVariantT', runVariant, runVariant',
... | null | https://raw.githubusercontent.com/pepeiborra/term/7644e0f8fbc81754fd5255602dd1f799adcd5938/Control/Monad/Variant.hs | haskell | | Renaming of variables
^ Original variable
^ Fresh variable
^ Result of renaming the original variable to the fresh variable
| Returns a fresh variable
| Renames with a fresh variable
* A Monad
| Runs a computation over the given set of fresh variables
| Runs a computation over the set of all variables enumer... | # LANGUAGE CPP #
# LANGUAGE StandaloneDeriving #
# LANGUAGE UndecidableInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
# LANGUAGE GeneralizedNewtypeDeriving #
module Control.Monad.Variant (
Rename(..),
MonadVariant(..),
MVariantT(..), runVariantT, runVariantT', runVariant, runVariant',
... |
40f5a14baa09f20fa6c1a7f514ed303eea94cbb4aa23d55fc8bd1b77b2fd77ed | tbsklg/advent-of-code-2022 | Day15.hs | module Day15 where
import Data.List (nub, sort)
import Data.List.Split (splitOn)
type Position = (Int, Int)
type Range = (Int, Int)
data Sensor = Sensor {position :: Position, closestBeacon :: Position} deriving (Show, Eq)
solve :: [String] -> Int
solve xs = numberOfScannedPositions numberOfPoints beaconsAtTargetL... | null | https://raw.githubusercontent.com/tbsklg/advent-of-code-2022/d62ac6ceb3910c572f09b5163b2ab9e5c09d7b91/src/Day15.hs | haskell | module Day15 where
import Data.List (nub, sort)
import Data.List.Split (splitOn)
type Position = (Int, Int)
type Range = (Int, Int)
data Sensor = Sensor {position :: Position, closestBeacon :: Position} deriving (Show, Eq)
solve :: [String] -> Int
solve xs = numberOfScannedPositions numberOfPoints beaconsAtTargetL... | |
ddeaa473483c7d29d4483bb36f8c743ca34cfda9c06a9e50d001169bd105f63f | zero-one-group/geni | rdd_test.clj | (ns zero-one.geni.rdd-test
(:require
[clojure.java.io :as io]
[clojure.string :as string]
[midje.sweet :refer [facts fact =>]]
[zero-one.geni.aot-functions :as aot]
[zero-one.geni.defaults]
[zero-one.geni.partitioner :as partitioner]
[zero-one.geni.rdd :as rdd]
[zero-one.geni.test-resources :r... | null | https://raw.githubusercontent.com/zero-one-group/geni/4dbabf8315d85cc1526e04bca7e4cb7b75c21ac1/test/zero_one/geni/rdd_test.clj | clojure | (ns zero-one.geni.rdd-test
(:require
[clojure.java.io :as io]
[clojure.string :as string]
[midje.sweet :refer [facts fact =>]]
[zero-one.geni.aot-functions :as aot]
[zero-one.geni.defaults]
[zero-one.geni.partitioner :as partitioner]
[zero-one.geni.rdd :as rdd]
[zero-one.geni.test-resources :r... | |
296152f4928110c409646f45277e14460f2ae078d4b1c0db807838efe94726d6 | bgaster/hopencl | Setup.hs | import System.Info
import Data.List
import Distribution.Simple
import Distribution.Simple.Setup
Inspired by the Setup.hs file included in - core
main = defaultMainWithHooks hooks
where hooks | os == "mingw32" = autoconfUserHooks { postConf = generateBuildInfo }
| otherwise = simpleUserHoo... | null | https://raw.githubusercontent.com/bgaster/hopencl/a5b6387cd32d3ca3338b4f433a363e3a581c0bf9/Setup.hs | haskell | import System.Info
import Data.List
import Distribution.Simple
import Distribution.Simple.Setup
Inspired by the Setup.hs file included in - core
main = defaultMainWithHooks hooks
where hooks | os == "mingw32" = autoconfUserHooks { postConf = generateBuildInfo }
| otherwise = simpleUserHoo... | |
04c828516a1b0771dc8fec83c1672b3b3557bdb0cee5adf165bc483119372b1c | morpheusgraphql/morpheus-graphql | Event.hs | # LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE TypeFamilies #
# LANGUAGE NoImplicitPrelude #
module Data.Morpheus.Subscriptions.Event
( Event (..),
runEvents,
)
where
import Data.Morpheus.App.Internal.Resolving
( EventHandler (..),
)
import Relude
data Event ch con = Event
{ channels ... | null | https://raw.githubusercontent.com/morpheusgraphql/morpheus-graphql/c176cc86e590ae5cecadb8ee02bd608be8b88c5f/morpheus-graphql-subscriptions/src/Data/Morpheus/Subscriptions/Event.hs | haskell | # LANGUAGE GADTs # | # LANGUAGE FlexibleInstances #
# LANGUAGE TypeFamilies #
# LANGUAGE NoImplicitPrelude #
module Data.Morpheus.Subscriptions.Event
( Event (..),
runEvents,
)
where
import Data.Morpheus.App.Internal.Resolving
( EventHandler (..),
)
import Relude
data Event ch con = Event
{ channels :: [ch],
content ::... |
e5f939ba3e93dad843757601eb276480000a9b8a365fb46def4c8097250906c8 | inhabitedtype/ocaml-aws | describeDBClusterEndpoints.mli | open Types
type input = DescribeDBClusterEndpointsMessage.t
type output = DBClusterEndpointMessage.t
type error = Errors_internal.t
include
Aws.Call with type input := input and type output := output and type error := error
| null | https://raw.githubusercontent.com/inhabitedtype/ocaml-aws/b6d5554c5d201202b5de8d0b0253871f7b66dab6/libraries/rds/lib/describeDBClusterEndpoints.mli | ocaml | open Types
type input = DescribeDBClusterEndpointsMessage.t
type output = DBClusterEndpointMessage.t
type error = Errors_internal.t
include
Aws.Call with type input := input and type output := output and type error := error
| |
0697ab50ed08f442d633d51e45128bdef6bc7a916018a03eec431d7fba37576d | fabricate-site/fabricate | test_utils.clj | (ns site.fabricate.prototype.test-utils
(:require
[malli.core :as m]
[malli.error :as me]
[malli.instrument :as mi]
[clojure.test :as t]
[clojure.pprint :as pprint]))
(defn with-instrumentation [f]
(mi/collect!)
(mi/instrument!)
(f)
(mi/unstrument!))
(defmethod t/assert-expr 'valid-schema? [m... | null | https://raw.githubusercontent.com/fabricate-site/fabricate/c563b56b5378197ac05b94505255a2df16bf8e41/test/site/fabricate/prototype/test_utils.clj | clojure | meta, indeed | (ns site.fabricate.prototype.test-utils
(:require
[malli.core :as m]
[malli.error :as me]
[malli.instrument :as mi]
[clojure.test :as t]
[clojure.pprint :as pprint]))
(defn with-instrumentation [f]
(mi/collect!)
(mi/instrument!)
(f)
(mi/unstrument!))
(defmethod t/assert-expr 'valid-schema? [m... |
c42ed1901c8dd71918583e32e3d10c84b254e52cdbdaa2b655d6541299a16008 | haskell-CI/hackage-matrix-builder | Main.hs | {-# LANGUAGE DeriveGeneric #-}
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE StrictData #
-- WARNING: the code that follows will make you cry;
-- a s... | null | https://raw.githubusercontent.com/haskell-CI/hackage-matrix-builder/bb813e9e4cf0d08352f33004c00ede987f45da56/src-exe/Controller/Main.hs | haskell | # LANGUAGE DeriveGeneric #
# LANGUAGE OverloadedStrings #
WARNING: the code that follows will make you cry;
a safety pig is provided below for your benefit.
_
_._ _..._ .-', _.._(`))
'-. ` ' /-._.-' ',/
) \ '.
/ _ ... | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
# LANGUAGE StrictData #
Copyright : © 2018
SPDX - License - Identifier : GPL-3.0 - or - later
module Main (main) where
import Prelude.Local
import Con... |
31159106b05d18b78e10652cf800c806bcd5595fa38797858c9394b15490a998 | vaclavsvejcar/headroom | header-line.hs | -- |
-- Module : Test
-- Description : Short description (line)
Copyright : ( c ) Some , 2013
Someone Else , 2014
-- License : GPL-3
Maintainer :
-- Stability : experimental
-- Portability : POSIX
--
-- Here is a longer description of this module, containing some
commentary ... | null | https://raw.githubusercontent.com/vaclavsvejcar/headroom/9f0fe38b91577e5368a46d21e7caccdfae0bf09c/test-data/code-samples/haskell/header-line.hs | haskell | |
Module : Test
Description : Short description (line)
License : GPL-3
Stability : experimental
Portability : POSIX
Here is a longer description of this module, containing some | Copyright : ( c ) Some , 2013
Someone Else , 2014
Maintainer :
commentary with @some markup@. |
e4c65231f95b2df075a1182dde6d2341e05c7652d1e94e8a04e5bfc37cdcd475 | alejandrogallo/keyboard-lab | Pcb.hs | # LANGUAGE FlexibleInstances #
{-# LANGUAGE TypeSynonymInstances #-}
module Kicad.Pcb where
import Data.List (intersperse)
import qualified Templates as TPL
import qualified Sexpr as S
import qualified Kicad.Module as KM
type Header = (Int, String)
data General = General
{ thickness :: Double
, drawings :: Int
... | null | https://raw.githubusercontent.com/alejandrogallo/keyboard-lab/e261933a5c4ff3733ccbd951b8830b9dc66bbd32/Kicad/Pcb.hs | haskell | # LANGUAGE TypeSynonymInstances #
sexpr PageA4 = S.List [S.Symbol "page", S.Symbol "A4"] | # LANGUAGE FlexibleInstances #
module Kicad.Pcb where
import Data.List (intersperse)
import qualified Templates as TPL
import qualified Sexpr as S
import qualified Kicad.Module as KM
type Header = (Int, String)
data General = General
{ thickness :: Double
, drawings :: Int
, tracks :: Int
, zones :: Int
,... |
908b37875db6e10842c107c133f818d2f25e7575510340515854e81ae3eab832 | zotonic/zotonic | mod_facebook.erl | @author < >
2010
%%
%% @doc Facebook integration. Adds Facebook login and other functionalities.
Copyright 2010
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% ... | null | https://raw.githubusercontent.com/zotonic/zotonic/62d959610061e6d2a8aed316b63fc1dafa3dd058/apps/zotonic_mod_facebook/src/mod_facebook.erl | erlang |
@doc Facebook integration. Adds Facebook login and other functionalities.
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 e... | @author < >
2010
Copyright 2010
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(mod_facebook).
-author("Marc Worrell <>").
-mod_title("Facebook").
-mod_description("Adds Facebook login and other Faceb... |
75799e311321a954caf3287e6d8102b7bb02f534c52d626dadd2a0e62d507171 | m4b/rdr | ElfVersion.ml | open Binary
type elf32_verdef = {
vd_version: int [@size 4];
vd_flags: int [@size 4];
vd_ndx: int [@size 4];
vd_cnt: int [@size 4];
vd_hash: int [@size 4];
vd_aux: int [@size 4];
vd_next: int [@size 4];
}
type elf64_verdef = {
vd_version: int [@size 8];
vd_flags: int [@size 8];
... | null | https://raw.githubusercontent.com/m4b/rdr/2bf1f73fc317cd74f8c7cacd542889df729bd003/lib/elf/ElfVersion.ml | ocaml | open Binary
type elf32_verdef = {
vd_version: int [@size 4];
vd_flags: int [@size 4];
vd_ndx: int [@size 4];
vd_cnt: int [@size 4];
vd_hash: int [@size 4];
vd_aux: int [@size 4];
vd_next: int [@size 4];
}
type elf64_verdef = {
vd_version: int [@size 8];
vd_flags: int [@size 8];
... | |
a5844409423f853fcf47c3b6e26875064a3945b20c0d42eefab091eb19d77c86 | webyrd/tabling | vanilla-r5-minimal.scm | miniKanren tabling code by
(load "mkimpl.scm")
(define make-cache (lambda (ansv*) (vector 'cache ansv*)))
(define cache-ansv* (lambda (v) (vector-ref v 1)))
(define cache-ansv*-set! (lambda (v val) (vector-set! v 1 val)))
(define make-ss (lambda (cache ansv* f) (vector 'ss cache ansv* f)))
(define ss? (lambda (v... | null | https://raw.githubusercontent.com/webyrd/tabling/3ace7adfd272a99ca20a01c2b47cbfe14a830729/vanilla-r5-minimal.scm | scheme | Do not include in diss | miniKanren tabling code by
(load "mkimpl.scm")
(define make-cache (lambda (ansv*) (vector 'cache ansv*)))
(define cache-ansv* (lambda (v) (vector-ref v 1)))
(define cache-ansv*-set! (lambda (v val) (vector-set! v 1 val)))
(define make-ss (lambda (cache ansv* f) (vector 'ss cache ansv* f)))
(define ss? (lambda (v... |
5c6535337f79da529269a910251a83bd72ade310bd1cd3a809a97e972f1ad479 | CDSoft/abp | DiagramSpec.hs |
This file is part of ABP .
ABP is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ) any later version .
ABP is distributed... | null | https://raw.githubusercontent.com/CDSoft/abp/98e042066869aa5b898096c31b51d2b6dc316456/test/DiagramSpec.hs | haskell | # LANGUAGE QuasiQuotes, OverloadedStrings #
svg -o -e UTF-8 %i %o.svg`|]
svg -o -e UTF-8 %i %o.svg`|] |
This file is part of ABP .
ABP is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at your option ) any later version .
ABP is distributed... |
363b44ba05f9ac068dc6cfcf60065db584998bacca8eccfb0092fcf8a7e14da6 | martijnbastiaan/sprockell | DemoMultipleSprockells.hs | import Sprockell.System
This program demonstrates how to run multiple sprockells at once , each executing
their own subprogram .
The holding SPID > 0 will read from their respective memory addresses
until they find a value which is not equal to zero . If it finds such a value , it
jumps... | null | https://raw.githubusercontent.com/martijnbastiaan/sprockell/503c91b85f2ff1a6d3293a6691ea9799a7693bf2/src/DemoMultipleSprockells.hs | haskell | BEGIN: loop
END: loop | import Sprockell.System
This program demonstrates how to run multiple sprockells at once , each executing
their own subprogram .
The holding SPID > 0 will read from their respective memory addresses
until they find a value which is not equal to zero . If it finds such a value , it
jumps... |
939e8b5a8d835612bc8613fb12d55c5d4311048c68ac3542d478ca8dca21781d | tonyrog/xylan | xylan_clt_sup.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2017 ,
%%% @doc
%%%
%%% @end
Created : 18 Mar 2017 by < >
%%%-------------------------------------------------------------------
-module(xylan_clt_sup).
-behaviour(supervisor).
%% API
-export([start_link/0]).
%% S... | null | https://raw.githubusercontent.com/tonyrog/xylan/9543f5798746c7119544cc51c3237a294d9a6b4b/src/xylan_clt_sup.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
Supervisor callbacks
===================================================================
API functions
=============================================================... | @author < >
( C ) 2017 ,
Created : 18 Mar 2017 by < >
-module(xylan_clt_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-define(SERVER, ?MODULE).
-define(CHILD(I, E, Type), {I, {I, start_link, E}, permanent, 5000, Type, [I]}).
( ) - > { ok , Pid } | ignore | { error ,... |
04df0970cf8db40104eb0be091311bc9414eb90f1111ccce9c11aeb4876bf9d6 | zyrolasting/mind-map | info.rkt | #lang info
(define collection "mind-map")
(define deps '("base" "racket-graphviz"))
(define build-deps '("scribble-lib" "racket-doc" "rackunit-lib"))
(define scribblings '(("scribblings/mind-map.scrbl" ())))
(define pkg-desc "Write and render mind maps in Racket")
(define version "0.0")
(define pkg-authors '(sage))
(de... | null | https://raw.githubusercontent.com/zyrolasting/mind-map/8401400f1dbc7956357cd27563b6926f4e429d7c/info.rkt | racket | #lang info
(define collection "mind-map")
(define deps '("base" "racket-graphviz"))
(define build-deps '("scribble-lib" "racket-doc" "rackunit-lib"))
(define scribblings '(("scribblings/mind-map.scrbl" ())))
(define pkg-desc "Write and render mind maps in Racket")
(define version "0.0")
(define pkg-authors '(sage))
(de... | |
1691ce4c01e2fea011c70d6b9dd4cbd16b6dc31de46ca2e82829ed6db333f40a | fbellomi/crossclj | source_info.clj | Copyright ( c ) , Rich Hickey & contributors .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be b... | null | https://raw.githubusercontent.com/fbellomi/crossclj/7630270ebe9ea3df89fe3d877b2571e6eae1062b/src/cloned/clojure/tools/analyzer/passes/source_info.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) , Rich Hickey & contributors .
(ns cloned.clojure.tools.analyzer.passes.source-info
(:require [cloned.clojure.tools.analyzer.utils :refer [-source-info merge']]
[cloned.clojure.tools.analyzer.ast :refer [update-children]]))
(defn -merge-source-info [source-info]
(fn [ast]
(up... |
f5cab32db5fa0838da2485aee69ec5f272afba1917a24a625e129412d0187559 | input-output-hk/ouroboros-network | Pipe.hs | # LANGUAGE CPP #
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# OPTIONS_GHC -Wno - orphans #
# OPTIONS_GHC -Wno - incomplete - uni - patterns #
module Test.Pipe (tests) where
import Codec.S... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/2f09ddd9282916858ba5d6b4b340cddbaf050d7e/ouroboros-network/test/Test/Pipe.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
The list of all tests
Properties
| The bundle of mini-protocols in our demo protocol: only chain sync
| A demonstration that we can run the simple chain consumer protocol
over a pipe with full message serialisation, framing etc.
and async IO ... | # LANGUAGE CPP #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# OPTIONS_GHC -Wno - orphans #
# OPTIONS_GHC -Wno - incomplete - uni - patterns #
module Test.Pipe (tests) where
import Codec.Serialise (Serialise (..))
import Control.Concurrent.Class.MonadS... |
5062be0e179bcee1f386960b22a0a84b59d275f15d6080b95f4405f0c6cc1c77 | triffon/fp-2021-22 | code.rkt | #lang r5rs
(define (str-chr? str c)
(define (iter i)
(if (= i (string-length str))
#f
(if (eq? c (string-ref str i))
#t
(iter (+ i 1)))))
(iter 0))
(define (str-sub-iter str a b)
(define (iter i res)
(if (< i a)
(iter (+ i 1) res)
(if (> i b... | null | https://raw.githubusercontent.com/triffon/fp-2021-22/e8e71eb7f36b9e8f9ec59e336def384e063208a8/exercises/3/04-scheme-strings/code.rkt | racket | #lang r5rs
(define (str-chr? str c)
(define (iter i)
(if (= i (string-length str))
#f
(if (eq? c (string-ref str i))
#t
(iter (+ i 1)))))
(iter 0))
(define (str-sub-iter str a b)
(define (iter i res)
(if (< i a)
(iter (+ i 1) res)
(if (> i b... | |
0657f8e7a14f900e2a85bd6f09937fb70dfd92a88d19fe35b707d690b32b8628 | stepcut/plugins | API.hs |
module API where
data Interface = Interface {
function :: String
}
plugin :: Interface
plugin = Interface { function = "goodbye" }
| null | https://raw.githubusercontent.com/stepcut/plugins/52c660b5bc71182627d14c1d333d0234050cac01/testsuite/makewith/should_fail_0/api/API.hs | haskell |
module API where
data Interface = Interface {
function :: String
}
plugin :: Interface
plugin = Interface { function = "goodbye" }
| |
4c2942381b9c54e94931e1f7cdbf0c405a96031f2c6333964a577cb21fe9f824 | marigold-dev/deku | random.mli | val generate : int -> Cstruct.t
val int : int -> int
val int32 : int32 -> int32
| null | https://raw.githubusercontent.com/marigold-dev/deku/21ec2bf05ce688c5b6012be16545175e75403f06/deku-p/src/core/crypto/random.mli | ocaml | val generate : int -> Cstruct.t
val int : int -> int
val int32 : int32 -> int32
| |
a983fbed80565607f45bb88fc655896e01b11f53f232ffe1223a1e5df4cbf028 | iokasimov/pandora | Semilattice.hs | module Pandora.Pattern.Object.Semilattice (Infimum (..), Supremum (..), Semilattice) where
{- |
> When providing a new instance, you should ensure it satisfies:
> * Associativity: x /\ (y /\ z) ≡ (x /\ y) /\ z
> * Commutativity: x /\ y ≡ y /\ x
> * Idempotency: x /\ x ≡ x
-}
class Infimum a where
# MINIMAL ( /\ ) #
... | null | https://raw.githubusercontent.com/iokasimov/pandora/4ff22ccf1c9824e3072d2ea0163b923798528b3a/Pandora/Pattern/Object/Semilattice.hs | haskell | |
> When providing a new instance, you should ensure it satisfies:
> * Associativity: x /\ (y /\ z) ≡ (x /\ y) /\ z
> * Commutativity: x /\ y ≡ y /\ x
> * Idempotency: x /\ x ≡ x
| module Pandora.Pattern.Object.Semilattice (Infimum (..), Supremum (..), Semilattice) where
class Infimum a where
# MINIMAL ( /\ ) #
(/\) :: a -> a -> a
|
> When providing a new instance , you should ensure it satisfies :
> * Associativity : x \/ ( y \/ z ) ≡ ( x \/ y ) \/ z
> * Commutativity : x \/ y ≡ y \/... |
373f5e02d8546374e8e6db449a4606192b7f43d21339a3e600e4df7162d69b01 | cljspad/cljspad | effects.cljs | (ns cljspad.effects
"Global effects"
(:require [rehook.dom :refer-macros [defui]]
[rehook.core :as rehook]
[clojure.string :as str]
[cljs.tools.reader.edn :as edn]
[cljspad.logging :as log]
[cljspad.env :as env]
[cljspad.util :as util]
... | null | https://raw.githubusercontent.com/cljspad/cljspad/f59ca0b8562e996cea36842427e74a57d4d2de48/src/cljspad/effects.cljs | clojure | (ns cljspad.effects
"Global effects"
(:require [rehook.dom :refer-macros [defui]]
[rehook.core :as rehook]
[clojure.string :as str]
[cljs.tools.reader.edn :as edn]
[cljspad.logging :as log]
[cljspad.env :as env]
[cljspad.util :as util]
... | |
bc48ed43751c5984a213fc05d0c865336118d0a0ff35274582053c257637b189 | lambdamikel/DLMAPS | racer-dag.lisp | -*- Mode : LISP ; Syntax : Common - Lisp ; Package : RACER - DAG -*-
(in-package :RACER-DAG)
;;;
;;;
;;;
(defclass racer-taxonomy (dag)
((dag::tprinter :initform 'equivalent-nodes)))
(defclass racer-taxonomy-node (dag-node)
((equivalent-nodes :accessor equivalent-nodes :initarg :equivalent-nodes)))
(defun ... | null | https://raw.githubusercontent.com/lambdamikel/DLMAPS/7f8dbb9432069d41e6a7d9c13dc5b25602ad35dc/src/tools/racer-dag.lisp | lisp | Syntax : Common - Lisp ; Package : RACER - DAG -*-
|
(in-package :RACER-DAG)
(defclass racer-taxonomy (dag)
((dag::tprinter :initform 'equivalent-nodes)))
(defclass racer-taxonomy-node (dag-node)
((equivalent-nodes :accessor equivalent-nodes :initarg :equivalent-nodes)))
(defun get-racer-taxonomy (tbox &optional (classify-tbox-p t))
(let ((*print-readably* n... |
0a7e836b6c44bcb33757cc9d769251b802e55d3fc7234f3a99c5fc919c9171e1 | huangz1990/SICP-answers | 44-smooth.scm | 44-smooth.scm
(define dx 0.00001)
(define (smooth f)
(lambda (x)
(/ (+ (f (- x dx))
(f x)
(f (+ x dx)))
3)))
| null | https://raw.githubusercontent.com/huangz1990/SICP-answers/15e3475003ef10eb738cf93c1932277bc56bacbe/chp1/code/44-smooth.scm | scheme | 44-smooth.scm
(define dx 0.00001)
(define (smooth f)
(lambda (x)
(/ (+ (f (- x dx))
(f x)
(f (+ x dx)))
3)))
| |
9e595ed1dc462262db5d85a27a407883210660a9eb228600fd790c6fca213df9 | Profpatsch/yarn2nix | Cli.hs | # LANGUAGE OverloadedStrings , LambdaCase , NoImplicitPrelude #
# LANGUAGE TypeApplications #
{-|
Description: command line interface
-}
module Distribution.Nixpkgs.Nodejs.Cli
( cli
, parseArgsPure
)
where
import Protolude
import qualified Data.ByteString.Lazy as BL
import qualified Data.Text as T
import qualified Dat... | null | https://raw.githubusercontent.com/Profpatsch/yarn2nix/2f610297bd7a08592f832b0807bf64e8dfd7a4f9/yarn2nix/src/Distribution/Nixpkgs/Nodejs/Cli.hs | haskell | |
Description: command line interface
^ Output a nix expression for a @yarn.lock@
^ Output a nix template corresponding to a @package.json@
its command line arguments and valid for the current invocation only.
requires network access. Currently this means
will throw an error in case resolving a hash
requ... | # LANGUAGE OverloadedStrings , LambdaCase , NoImplicitPrelude #
# LANGUAGE TypeApplications #
module Distribution.Nixpkgs.Nodejs.Cli
( cli
, parseArgsPure
)
where
import Protolude
import qualified Data.ByteString.Lazy as BL
import qualified Data.Text as T
import qualified Data.Text.IO as TIO
import qualified Options.A... |
93267defe81beaf2718e42016a37011950efb1d907398bc7ccb6158579c665d4 | janestreet/rpc_parallel | for_testing_internal.ml | open! Core
open Async
let env_var = "RPC_PARALLEL_EXPECT_TEST_INITIALIZE"
let initialize_source_code_position = ref None
let set_initialize_source_code_position here =
initialize_source_code_position := Some (Source_code_position.to_string here)
;;
let worker_environment () =
match !initialize_source_code_positi... | null | https://raw.githubusercontent.com/janestreet/rpc_parallel/a96c725d3b350d755fafe3d5ff4ac60953c3224f/src/for_testing_internal.ml | ocaml | open! Core
open Async
let env_var = "RPC_PARALLEL_EXPECT_TEST_INITIALIZE"
let initialize_source_code_position = ref None
let set_initialize_source_code_position here =
initialize_source_code_position := Some (Source_code_position.to_string here)
;;
let worker_environment () =
match !initialize_source_code_positi... | |
ddf0321b55aba2a8d0656a92820db7e289e031c37a7d943f9f4e8145309f5b02 | BitGameEN/bitgamex | gproc.erl | ` ` The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Public License along with this software. If not, it can be
%% retrieved via the world wide... | null | https://raw.githubusercontent.com/BitGameEN/bitgamex/151ba70a481615379f9648581a5d459b503abe19/src/deps/gproc/src/gproc.erl | erlang | compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved via the world wide web at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
u... | ` ` The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
The Initial Developer of the Original Code is Ericsson Utvecklings AB .
Portions created by Eri... |
664b3449cde053bdf5b862455b437a1e485228912b2cef595abc7d9c11a6f156 | dgiot/dgiot | dgiot_rule_locker.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 - 2021 EMQ Technologies Co. , Ltd. 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 o... | null | https://raw.githubusercontent.com/dgiot/dgiot/a6b816a094b1c9bd024ce40b8142375a0f0289d8/apps/dgiot/src/rules/dgiot_rule_locker.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 ... | Copyright ( c ) 2020 - 2021 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(dgiot_rule_locker).
-export([start_link/0]).
-export([ lock/1
, unlock/1
... |
81ca92fe34e7b74d69521161f5de2ccdea0c1570a6db262af2e79137c0801ee1 | nuscr/nuscr | ocamlcodegen.ml | open! Base
open Printf
open! Ppxlib_ast
open Parsetree
open Asttypes
open Longident
open! Ast_helper
open Names
open Efsm
open Message
let mk_lid id = Location.mknoloc (Option.value_exn (unflatten [id]))
let mk_constr id = Typ.constr (mk_lid id) []
let mk_variant desc =
{prf_desc= desc; prf_loc= Location.none; prf... | null | https://raw.githubusercontent.com/nuscr/nuscr/afef8aa7b0452e51b48cd101278512dcd7869b3b/lib/codegen/ocaml/ocamlcodegen.ml | ocaml | open! Base
open Printf
open! Ppxlib_ast
open Parsetree
open Asttypes
open Longident
open! Ast_helper
open Names
open Efsm
open Message
let mk_lid id = Location.mknoloc (Option.value_exn (unflatten [id]))
let mk_constr id = Typ.constr (mk_lid id) []
let mk_variant desc =
{prf_desc= desc; prf_loc= Location.none; prf... | |
a8b51b7fcbd180a633171bf212ab09f4e7e4a06eb5d36f772b56cc4a99719ca0 | mattmundell/nightshade | csv.lisp | ;;; -*- Package: CSV -*-
(defpackage "CSV"
(:version 1)
(:use "LISP" "ED" "EDI")
(:export "parse-buffer" "parse-buffer-into-list"
"parse-buffer-into-node")
(:documentation "Comma Separated Value (CSV) file parser."))
;; FIX flag for header
FIX implement , use more - general " SV " where delimiter can... | null | https://raw.githubusercontent.com/mattmundell/nightshade/7a67f9eac96414355de1463ec251b98237cb4009/src/packages/csv.lisp | lisp | -*- Package: CSV -*-
FIX flag for header
could approach awk? |
(defpackage "CSV"
(:version 1)
(:use "LISP" "ED" "EDI")
(:export "parse-buffer" "parse-buffer-into-list"
"parse-buffer-into-node")
(:documentation "Comma Separated Value (CSV) file parser."))
FIX implement , use more - general " SV " where delimiter can be specified
(in-package "CSV")
(export '(par... |
9082cbb863ddecd86afa76b508ec39e49615b87fe0488ae87472fd91d49215e6 | nvim-treesitter/nvim-treesitter | injections.scm | (comment) @comment
(heredoc_template
(template_literal) @content
(heredoc_identifier) @language
(#set! "language" @language)
(#downcase! "language"))
| null | https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/599fd416c81498fe0fe619e00c1aa316cbf8d964/queries/hcl/injections.scm | scheme | (comment) @comment
(heredoc_template
(template_literal) @content
(heredoc_identifier) @language
(#set! "language" @language)
(#downcase! "language"))
| |
9af2b86a3e68afe3e7bd99a0bbe9f472ab68af50e265f139f1d05ffee5a7f009 | input-output-hk/Alonzo-testnet | plutus-helloworld-literal-bytestring.hs | import Prelude
import Data.String
import System.Environment
import Cardano.Api
import qualified Plutus.V1.Ledger.Api as Plutus
import qualified Data.ByteString.Short as SBS
import Cardano.PlutusExample.HelloWorldLiteralByteString (helloWorldSBS, helloWorldSerialised... | null | https://raw.githubusercontent.com/input-output-hk/Alonzo-testnet/ddfe8f077570c6a7530123dfa29feb171061f3db/resources/plutus-sources/plutus-helloworld/app/plutus-helloworld-literal-bytestring.hs | haskell | import Prelude
import Data.String
import System.Environment
import Cardano.Api
import qualified Plutus.V1.Ledger.Api as Plutus
import qualified Data.ByteString.Short as SBS
import Cardano.PlutusExample.HelloWorldLiteralByteString (helloWorldSBS, helloWorldSerialised... | |
b6dfc77acea457c989e11288fc52dc804bb16f7771d6499fa628cec1aaae34e5 | valpackett/clj-http-fake | fake.clj | (ns clj-http.test.fake
(:require [clj-http.client :as http]
[clj-http.core :as core]
[clj-http.util :as util])
(:use [clj-http.fake]
[clojure.test]
:reload-all)
(:import (java.net ConnectException)))
(deftest many-qparams-performance-test
(let [num-qparams 10]
(is (... | null | https://raw.githubusercontent.com/valpackett/clj-http-fake/df2d706c395c562be8b79c212d5ec90f9a729351/test/clj_http/test/fake.clj | clojure | (ns clj-http.test.fake
(:require [clj-http.client :as http]
[clj-http.core :as core]
[clj-http.util :as util])
(:use [clj-http.fake]
[clojure.test]
:reload-all)
(:import (java.net ConnectException)))
(deftest many-qparams-performance-test
(let [num-qparams 10]
(is (... | |
bed2b4fc2053e7e83631172f3a8b42b78ef2d2dd52dbf7f73ddd7d46386aee96 | coalton-lang/coalton | immutable-map.lisp | (defpackage #:coalton-impl/algorithm/immutable-map
(:use #:cl)
(:export
#:immutable-map ; STRUCT
CONSTRUCTOR
ACCESSOR
#:immutable-map-lookup ; FUNCTION
#:immutable-map-set ; FUNCTION
#:immutable-map-set-multiple ; FUNCTION
#:immutable-ma... | null | https://raw.githubusercontent.com/coalton-lang/coalton/d91d11d95d70a38d199bf1b4e68ff342f1815d94/src/algorithm/immutable-map.lisp | lisp | STRUCT
FUNCTION
FUNCTION
FUNCTION
FUNCTION
FUNCTION
FUNCTION
Immutable Map
Wrapper around fset:map
| (defpackage #:coalton-impl/algorithm/immutable-map
(:use #:cl)
(:export
CONSTRUCTOR
ACCESSOR
))
(in-package #:coalton-impl/algorithm/immutable-map)
(defstruct immutable-map
(data (fset:empty-map) :type fset:map :read-only t))
(defmethod make-load-form ((self immutable-map) &optional env)
(make-load-... |
ee13cac263c4e11d50643f5833c037d23107cc63800bf60428af396a91638e78 | well-typed/large-records | R010.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE PatternSynonyms #
{-# LANGUAGE ViewPatterns #-}
#if __GLASGOW_HASKELL__ >= 902
# LANGUAGE NoFieldSelectors #
#endif
#if PROFILE_CORESIZE
{-# OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #-}
#endif
#if PROFILE_TIMING
{-# OPTIONS_GHC -ddump-to-file -d... | null | https://raw.githubusercontent.com/well-typed/large-records/c6c2b51af11e90f30822543d7ce4d1cb28cee294/large-records-benchmarks/bench/experiments/Experiment/PatternSynonym_NFS/Sized/R010.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE ViewPatterns #
# OPTIONS_GHC -ddump-to-file -ddump-ds-preopt -ddump-ds -ddump-simpl #
# OPTIONS_GHC -ddump-to-file -ddump-timings # | # LANGUAGE PatternSynonyms #
#if __GLASGOW_HASKELL__ >= 902
# LANGUAGE NoFieldSelectors #
#endif
#if PROFILE_CORESIZE
#endif
#if PROFILE_TIMING
#endif
module Experiment.PatternSynonym_NFS.Sized.R010 where
import Bench.Types
data R
viewR :: R -> (
(T 00, T 01, T 02, T 03, T 04, T 05, T 06, T 07, T 08, T 09)
... |
e7b4313e2203344fa0911ed124ce5e7ddf0b8b14e0c3758197b12b2ded7ab6c4 | diskuv/dkml-c-probe | c_conf.ml | (******************************************************************************)
Copyright 2022 Diskuv , Inc.
(* *)
Licensed under the Apache License , Version 2.0 ( the " License " ) ; ... | null | https://raw.githubusercontent.com/diskuv/dkml-c-probe/06e349a680651cab53e8fd88df974fa960bf9c0e/src/c_conf.ml | ocaml | ****************************************************************************
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
... | Copyright 2022 Diskuv , Inc.
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
type t = {
envname_suffixes : string list;
env_getter : env_getter;
}
... |
3eec7296824fbb866625b2f4d3f63dc7172cc746f0cd7f8fd0719ae9f16613d3 | danilkolikov/dfl | HeaderProcessor.hs | |
Module : Frontend . Syntax . HeaderProcessor
Description : Lexical Analyser of DFL
Copyright : ( c ) , 2019
License : MIT
Lexical analyser of DFL . Does layout - based lexing and parses header of a module .
Module : Frontend.Syntax.HeaderProcessor
Description : Lexical An... | null | https://raw.githubusercontent.com/danilkolikov/dfl/698a8f32e23b381afe803fc0e353293a3bf644ba/src/Frontend/HeaderProcessor.hs | haskell | | Errors which can be encountered during processing
^ Parsing error
| Output of the processor
| Debug output of the syntax processor
| Processes syntax of the module - does lexing and parses a header | |
Module : Frontend . Syntax . HeaderProcessor
Description : Lexical Analyser of DFL
Copyright : ( c ) , 2019
License : MIT
Lexical analyser of DFL . Does layout - based lexing and parses header of a module .
Module : Frontend.Syntax.HeaderProcessor
Description : Lexical An... |
8f6be9d6a289ecb78f03e87a90b653f2a184b0b97e0c23be2cc56ff9f65b0993 | freizl/dive-into-haskell | labweekexercise.hs | Informatics 1 - Functional Programming
Lab Week Exercise
--
import Test.QuickCheck
Exercise 3 :
double :: Int -> Int
double x = x + x
square :: Int -> Int
square x = x * x
Exercise 4 :
isTriple :: Int -> Int -> Int -> Bool
isTriple a b c = square a + square b == square c
Exercise 5 :
leg1 :: Int -> ... | null | https://raw.githubusercontent.com/freizl/dive-into-haskell/b18a6bfe212db6c3a5d707b4a640170b8bcf9330/lectures/informatics1-FP/2011-haisheng/Labweek/labweekexercise.hs | haskell |
| suppose to True for any input
| Informatics 1 - Functional Programming
Lab Week Exercise
import Test.QuickCheck
Exercise 3 :
double :: Int -> Int
double x = x + x
square :: Int -> Int
square x = x * x
Exercise 4 :
isTriple :: Int -> Int -> Int -> Bool
isTriple a b c = square a + square b == square c
Exercise 5 :
leg1 :: Int -> Int... |
8fb8226a05960c1ed26681cf6f7e156de79d0dc6145794cddcf071e4734c9786 | erlang/otp | sets.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2000 - 2023 . 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 applic... | null | https://raw.githubusercontent.com/erlang/otp/2b397d7e5580480dc32fa9751db95f4b89ff029e/lib/stdlib/src/sets.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 l... | Copyright Ericsson AB 2000 - 2023 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
The new version 2 has moved to use maps under the roof whenever a
The previous version ( version 1 ) uses the d... |
529f7c2efa2c67123ead9f140296dea090b1ca28793787f54afadef373513037 | mflatt/sirmail | recover.rkt | #lang scheme
(require mzlib/list net/head)
(define msgs
(sort (filter (lambda (x) (regexp-match #rx"^[0-9]*$" (path->string x))) (directory-list))
(lambda (a b) (< (string->number (path->string a))
(string->number (path->string b))))))
(define mailbox
(let loop ([msgs msgs][p 1])
(if (null? msgs)... | null | https://raw.githubusercontent.com/mflatt/sirmail/5a08636d126ea04b5c903ab42a6e7eb2b143d864/sirmail/recover.rkt | racket | #lang scheme
(require mzlib/list net/head)
(define msgs
(sort (filter (lambda (x) (regexp-match #rx"^[0-9]*$" (path->string x))) (directory-list))
(lambda (a b) (< (string->number (path->string a))
(string->number (path->string b))))))
(define mailbox
(let loop ([msgs msgs][p 1])
(if (null? msgs)... | |
30fccc515fb5ee4c5a72e178635e10b8fbf77470526a27cfa698fe6adac93d14 | witan-org/witan | env.ml | (*************************************************************************)
This file is part of Witan .
(* *)
Copyright ( C ) 2017
CEA ( Commi... | null | https://raw.githubusercontent.com/witan-org/witan/d26f9f810fc34bf44daccb91f71ad3258eb62037/src/core/env.ml | ocaml | ***********************************************************************
alternatives)
Automatique)
... | This file is part of Witan .
Copyright ( C ) 2017
CEA ( Commissariat à l'énergie atomique et aux énergies
( Institut National de Recherche en Informatique et en
CNRS ( Centre nation... |
150f9434aa2aee222cd0df2fbe0f4f1c7051f2d03738dc8b2eb776f6b21fb4c5 | processone/ejabberd | mod_stun_disco.erl | %%%----------------------------------------------------------------------
%%% File : mod_stun_disco.erl
Author : < >
Purpose : External Service Discovery ( XEP-0215 )
Created : 18 Apr 2020 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2020 - 2023 ProcessOne
%%%
%%% This program is free software; you c... | null | https://raw.githubusercontent.com/processone/ejabberd/c103182bc7e5b8a8ab123ce02d1959a54e939480/src/mod_stun_disco.erl | erlang | ----------------------------------------------------------------------
File : mod_stun_disco.erl
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without eve... | Author : < >
Purpose : External Service Discovery ( XEP-0215 )
Created : 18 Apr 2020 by < >
ejabberd , Copyright ( C ) 2020 - 2023 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have receiv... |
81724288ff9f7d9692adcbfbf17e69b6a77d868d55ae8c43b7a4b678c0140db7 | Metaxal/rascas | distribute.rkt | #lang racket/base
(require "misc.rkt"
"automatic-simplify.rkt"
racket/list)
(provide distribute
distribute-product)
(define (distribute-product u)
(distribute u '* '+))
;; 1.5× faster than the built-in one, but the order
;; of the resulting lists is reversed (the order within each list
... | null | https://raw.githubusercontent.com/Metaxal/rascas/540530c28689de50c526abf36079c07fd0436edb/distribute.rkt | racket | 1.5× faster than the built-in one, but the order
of the resulting lists is reversed (the order within each list
is the same though).
We have already checked before that these are lists
(for ([(l i) (in-indexed ls)])
Faster variant:
Recursively distributes `times` over `plus`, where `times` and `plus` are
registe... | #lang racket/base
(require "misc.rkt"
"automatic-simplify.rkt"
racket/list)
(provide distribute
distribute-product)
(define (distribute-product u)
(distribute u '* '+))
(define (cartesian-product . ls)
(unless (list? l)
(apply raise-argument-error 'cartesian-product "list?" i ... |
adb789ef074cea6e81ce4ab8387bf1dd9248894ddc832cd85dd6c1fb3369fa47 | kudu-dynamics/blaze | ModuOp.hs | module Blaze.Types.Pil.Op.ModuOp where
-- This module is generated. Please use app/gen_pil_ops/Main.hs to modify.
import Blaze.Prelude
data ModuOp expr = ModuOp
{ left :: expr
, right :: expr
} deriving (Eq, Ord, Show, Functor, Foldable, Traversable, Generic, FromJSON, ToJSON)
instance Hashable a => Hashable ... | null | https://raw.githubusercontent.com/kudu-dynamics/blaze/a385bb3b37a0a0e061217ebdd70dd0eecbb20332/src/Blaze/Types/Pil/Op/ModuOp.hs | haskell | This module is generated. Please use app/gen_pil_ops/Main.hs to modify. | module Blaze.Types.Pil.Op.ModuOp where
import Blaze.Prelude
data ModuOp expr = ModuOp
{ left :: expr
, right :: expr
} deriving (Eq, Ord, Show, Functor, Foldable, Traversable, Generic, FromJSON, ToJSON)
instance Hashable a => Hashable (ModuOp a)
|
b3d9b2028c4d303ff5c9dc4886ec687811bc321bdfd3ef2e03bde65c9742f7bb | 23Skidoo/ghc-parmake | C.hs | module C.C
where
cString :: IO ()
cString = print "C.cString"
| null | https://raw.githubusercontent.com/23Skidoo/ghc-parmake/c4d7fb042f5138588fa54d0153be1aee93db3835/tests/data/executable-mutrec/C/C.hs | haskell | module C.C
where
cString :: IO ()
cString = print "C.cString"
| |
3c7506ba0a78126f53dc9ed7bcd83771777a6049e410cd7deea655115399cdc3 | thlack/surfs | plain_text.clj | (ns ^:no-doc thlack.surfs.composition.spec.plain-text
(:require [clojure.spec.alpha :as s]
[thlack.surfs.composition.spec.text :as text]))
(s/def ::type #{:plain_text})
(s/def ::plain-text (s/keys :req-un [::type ::text/text] :opt-un [::text/emoji]))
| null | https://raw.githubusercontent.com/thlack/surfs/e03d137d6d43c4b73a45a71984cf084d2904c4b0/src/thlack/surfs/composition/spec/plain_text.clj | clojure | (ns ^:no-doc thlack.surfs.composition.spec.plain-text
(:require [clojure.spec.alpha :as s]
[thlack.surfs.composition.spec.text :as text]))
(s/def ::type #{:plain_text})
(s/def ::plain-text (s/keys :req-un [::type ::text/text] :opt-un [::text/emoji]))
| |
a5ed3107f8e053c16d1d23aef89bc01b507e9bd7f890fa257a4ce0e3c7797e4a | rorra/rorracasts_erlang | binarios.erl | -module(binarios).
-compile(export_all).
test() ->
Se escriben numeros en base 2 con el 2 # delante
io:format("2#01: ~w~n", [2#01]),
io:format("2#10: ~w~n", [2#10]),
io:format("2#100: ~w~n", [2#100]),
Se escriben numeros en base 16 con el 16 # delante
io:format("16#A: ~w~n", [16#A]),
io:format(... | null | https://raw.githubusercontent.com/rorra/rorracasts_erlang/c50d20abe3f1a65001576734caedae90f36e3ecd/014-binarios/binarios.erl | erlang | Operadores sobre bits
bnot
bsl, bits a la izquierda
bsr, bits a la derecha | -module(binarios).
-compile(export_all).
test() ->
Se escriben numeros en base 2 con el 2 # delante
io:format("2#01: ~w~n", [2#01]),
io:format("2#10: ~w~n", [2#10]),
io:format("2#100: ~w~n", [2#100]),
Se escriben numeros en base 16 con el 16 # delante
io:format("16#A: ~w~n", [16#A]),
io:format(... |
a7bef83667ccbf27f9fdf901e6b75b8054a19e60cf5a9ad0593fca727b06a98d | returntocorp/ocaml-tree-sitter-core | Protect_ident.ml | (*
Unit tests for the Protect_ident module.
*)
open Printf
open Tree_sitter_gen
let test_translate () =
let reserved_dst = ["foo"; "bar_"] in
let translations = [
"thing", None;
"foo", Some "foo_";
"bar", None;
"bar_", Some "bar__";
] in
let registry = Protect_ident.create ~reserved_dst () ... | null | https://raw.githubusercontent.com/returntocorp/ocaml-tree-sitter-core/28f750bb894ea4c0a7f6b911e568ab9d731cc0b5/src/gen/test/Protect_ident.ml | ocaml |
Unit tests for the Protect_ident module.
|
open Printf
open Tree_sitter_gen
let test_translate () =
let reserved_dst = ["foo"; "bar_"] in
let translations = [
"thing", None;
"foo", Some "foo_";
"bar", None;
"bar_", Some "bar__";
] in
let registry = Protect_ident.create ~reserved_dst () in
List.iter (fun (src, expected_dst) ->
let... |
de091ead03da1154e7833321fc9a887093c12cb8e15b151da0624b92dbad9152 | TokTok/hs-toxcore | Util.hs | {-# LANGUAGE StrictData #-}
module Network.Tox.SaveData.Util where
import Control.Monad (when)
import Data.Binary (Binary (get))
import Data.Binary.Get (Get)
import qualified Data.Binary.Get as Get
import Data.Binary.Put (Put)
import qualified Data.Binary.Put as Put
import... | null | https://raw.githubusercontent.com/TokTok/hs-toxcore/3ceab5974c36c4c5dbf7518ba733ec2b6084ce5d/src/Network/Tox/SaveData/Util.hs | haskell | # LANGUAGE StrictData #
| Consumes the entire stream and parses some Binary out of it in a loop. | module Network.Tox.SaveData.Util where
import Control.Monad (when)
import Data.Binary (Binary (get))
import Data.Binary.Get (Get)
import qualified Data.Binary.Get as Get
import Data.Binary.Put (Put)
import qualified Data.Binary.Put as Put
import Data.Word (... |
3cf08273054aecee0da2fba119cc9cb2a3a426a7607218f1f299c7bdab155bd7 | exoscale/pullq | main.clj | (ns pullq.main
(:gen-class)
(:require [clojure.string :as str]
[clojure.java.io :as io]
[clojure.pprint :refer [pprint]]
[clojure.tools.cli :refer [cli]]
[clj-time.format :refer [parse]]
[clj-time.coerce :refer [to-epoch]]
[tentacle... | null | https://raw.githubusercontent.com/exoscale/pullq/a1f4ed408cda61ac1454f5e7cf60b2f514702765/src/clj/pullq/main.clj | clojure | (pulls-with-details "pyr" "dot.emacs" auth) | (ns pullq.main
(:gen-class)
(:require [clojure.string :as str]
[clojure.java.io :as io]
[clojure.pprint :refer [pprint]]
[clojure.tools.cli :refer [cli]]
[clj-time.format :refer [parse]]
[clj-time.coerce :refer [to-epoch]]
[tentacle... |
6631fde3409e41676ed4cfbbb681a3952bd9f7f068bc9ec675422811798be074 | GaloisInc/saw-script | HeapsterBuiltins.hs | {-# LANGUAGE GADTs #-}
# LANGUAGE TypeOperators #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE TemplateHaskell #
# LANGUAGE DataKinds #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE KindSignatures #
# LANGUAGE... | null | https://raw.githubusercontent.com/GaloisInc/saw-script/9d66afc87e2afe70fbea40033f7f887c6a02558a/src/SAWScript/HeapsterBuiltins.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE RankNTypes #
# LANGUAGE OverloadedStrings #
, heapster_typecheck_fun_rs
, heapster_typecheck_fun_rename_rs
| Extract out the contents of the 'Right' of an 'Either', calling 'fail' if
the 'Either' is a 'Left'. The supplied 'String' describes the action (in
"ing" form, as in, "parsing")... | # LANGUAGE TypeOperators #
# LANGUAGE FlexibleContexts #
# LANGUAGE TemplateHaskell #
# LANGUAGE DataKinds #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE KindSignatures #
# LANGUAGE ImplicitParams #
# LANGUAGE ViewPatterns #
module SAWScript.HeapsterBuiltins
... |
e850d0761c195d99e5dd9b26366556d5fe8de8d9736033d67418624db4809139 | tolysz/ghcjs-stack | ExeV10.hs | module Distribution.Simple.Test.ExeV10
( runTest
) where
import Distribution.Compat.CreatePipe
import Distribution.Compat.Environment
import qualified Distribution.PackageDescription as PD
import Distribution.Simple.Build.PathsModule
import Distribution.Simple.BuildPaths
import Distribution.Simple.Compil... | null | https://raw.githubusercontent.com/tolysz/ghcjs-stack/83d5be83e87286d984e89635d5926702c55b9f29/special/cabal-next/Cabal/Distribution/Simple/Test/ExeV10.hs | haskell | Check that the test executable exists.
Remove old .tix files if appropriate.
Write summary notices indicating start of test suite
Read test executable's output lazily (returns immediately)
'--show-details=streaming': print the log output in another thread
Run the test executable
Add (DY)LD_LIBRARY_PATH if needed... | module Distribution.Simple.Test.ExeV10
( runTest
) where
import Distribution.Compat.CreatePipe
import Distribution.Compat.Environment
import qualified Distribution.PackageDescription as PD
import Distribution.Simple.Build.PathsModule
import Distribution.Simple.BuildPaths
import Distribution.Simple.Compil... |
012eac5069494c724ab7eaa9380a14718717b0d28a874d7411c133afb6f0d857 | mishun/tangles | Algebra.hs | # LANGUAGE FlexibleInstances , MultiParamTypeClasses , TypeFamilies #
module Math.Topology.KnotTh.Algebra
( Composition(..)
, Group(..)
, GroupAction(..)
, TensorProduct(..)
, extendedGCD
) where
class Composition a where
(∘) :: a -> a -> a
instance Composition (a -> a) where
(∘) = (.... | null | https://raw.githubusercontent.com/mishun/tangles/9af39dd48e3dcc5e3944f8d060c8769ff3d81d02/src/Math/Topology/KnotTh/Algebra.hs | haskell | # LANGUAGE FlexibleInstances , MultiParamTypeClasses , TypeFamilies #
module Math.Topology.KnotTh.Algebra
( Composition(..)
, Group(..)
, GroupAction(..)
, TensorProduct(..)
, extendedGCD
) where
class Composition a where
(∘) :: a -> a -> a
instance Composition (a -> a) where
(∘) = (.... | |
e3f5303b6eebce25ee233f511118b70a5d90a63a066b345c0884edac53e1ba70 | haskell-tools/haskell-tools | Newtype.hs | {-# LANGUAGE OverloadedStrings #-}
module Newtype where
import GHC.Exts (IsString(..))
newtype MyString = MyString String
deriving Eq
instance IsString MyString where
fromString = MyString
f :: MyString -> MyString
* OverloadedStrings , OverloadedStrings *
f x = x
| null | https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/builtin-refactorings/test/ExtensionOrganizerTest/OverloadedStringsTest/Newtype.hs | haskell | # LANGUAGE OverloadedStrings # |
module Newtype where
import GHC.Exts (IsString(..))
newtype MyString = MyString String
deriving Eq
instance IsString MyString where
fromString = MyString
f :: MyString -> MyString
* OverloadedStrings , OverloadedStrings *
f x = x
|
7545c1f21e9f4a5dc7096b68a67bec7d170fb487a8ffc49d721d60703b71acd7 | madstap/hugin | dbg.cljc | (ns hugin.dbg
"Debugging helpers.
< appended to a name means that the value is \"passed through\" the open paren,
meaning that you can drop these in anywhere without changing how the
rest of the code works."
(:require
[clojure.pprint :refer [pprint]]
#?@(:clj
[[clojure.edn :as edn]
[cloj... | null | https://raw.githubusercontent.com/madstap/hugin/668c548312e8b6ab38713c46e17776ac38c57e9b/src/hugin/dbg.cljc | clojure |
Printing
Debug atom
Misc
Vertical scroll is not cool...
TODO: defconj< ? | (ns hugin.dbg
"Debugging helpers.
< appended to a name means that the value is \"passed through\" the open paren,
meaning that you can drop these in anywhere without changing how the
rest of the code works."
(:require
[clojure.pprint :refer [pprint]]
#?@(:clj
[[clojure.edn :as edn]
[cloj... |
bcc2c56acfe7234090286a34b0eed9b511552e517e4978e01360d5ddcfd8c91c | florence/cover | bfs.rkt | #lang racket
;; this is a comment
(+ 1 2)
(λ (x) 3)
(module+ test 20)
(λ (x) 3)
(module+ test 20)
(λ (x) 3)
(module+ test 20)
(begin-for-syntax
(require (for-syntax (only-in racket/base require for-syntax #%app begin-for-syntax #%datum only-in)))
;; this is a comment
(+ 1 2)
(λ (x) 3)
(module+ test1 20)
(λ... | null | https://raw.githubusercontent.com/florence/cover/bc17e4e22d47b1da91ddaa5eafefe28f4675e85c/cover-test/cover/tests/bfs.rkt | racket | this is a comment
this is a comment | #lang racket
(+ 1 2)
(λ (x) 3)
(module+ test 20)
(λ (x) 3)
(module+ test 20)
(λ (x) 3)
(module+ test 20)
(begin-for-syntax
(require (for-syntax (only-in racket/base require for-syntax #%app begin-for-syntax #%datum only-in)))
(+ 1 2)
(λ (x) 3)
(module+ test1 20)
(λ (x) 3)
(module+ test1 20)
(λ (x) 3)
(... |
3c5309747a2ae9e7c0efdcb765d2db870386090a7dbcce319b309d37c21b3210 | nvim-treesitter/nvim-treesitter | highlights.scm | (_) @spell
((tag
(name) @text.todo
("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)?
":" @punctuation.delimiter)
(#eq? @text.todo "TODO"))
("text" @text.todo
(#eq? @text.todo "TODO"))
((tag
(name) @text.note
("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)?
":" ... | null | https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/ad9ae9e7def54fee446c3e186ed0a0d44cca7b90/queries/comment/highlights.scm | scheme | (_) @spell
((tag
(name) @text.todo
("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)?
":" @punctuation.delimiter)
(#eq? @text.todo "TODO"))
("text" @text.todo
(#eq? @text.todo "TODO"))
((tag
(name) @text.note
("(" @punctuation.bracket (user) @constant ")" @punctuation.bracket)?
":" ... | |
30843a33c8a14d966eedfc738f70a07b5617869858e3c68d12eef68c68b26571 | peey/ugly-tiny-infix-macro | error-handling.lisp | (in-package :ugly-tiny-infix-macro)
(define-condition malformed-infix-expression-error (error)
((text :initarg :text :reader malformed-infix-expression-error-text)
(expression :initarg :expression :reader malformed-infix-expression-error-expression)))
from
(defmethod print-object ((err malformed-infix-expres... | null | https://raw.githubusercontent.com/peey/ugly-tiny-infix-macro/0d476c3689fc19ff69c6acb2a7ad7a77b5532ea8/error-handling.lisp | lisp | for error checking | (in-package :ugly-tiny-infix-macro)
(define-condition malformed-infix-expression-error (error)
((text :initarg :text :reader malformed-infix-expression-error-text)
(expression :initarg :expression :reader malformed-infix-expression-error-expression)))
from
(defmethod print-object ((err malformed-infix-expres... |
94805aeb242847ab775206d38a2213935ec4e7ae4b1c5c0b4a26f4651018d808 | funimagej/fun.imagej | core.clj | (ns fun.imagej.core
(:require [clojure.pprint :as pprint]
[clojure.string :as string]
#_[fun.imagej.img :as img])
(:import [net.imagej ImageJ]))
; ImageJ gateway
(defonce ij (atom nil))
(defn get-ij
"Get the currently active ImageJ gateway."
[]
(when-not @ij
(when (= (System/getP... | null | https://raw.githubusercontent.com/funimagej/fun.imagej/dcbe14581ba9394d8ecc6e254e02fac8130a942d/src/fun/imagej/core.clj | clojure | ImageJ gateway
This has to run before ANY X11 commands are issued. | (ns fun.imagej.core
(:require [clojure.pprint :as pprint]
[clojure.string :as string]
#_[fun.imagej.img :as img])
(:import [net.imagej ImageJ]))
(defonce ij (atom nil))
(defn get-ij
"Get the currently active ImageJ gateway."
[]
(when-not @ij
(when (= (System/getProperty "useSciVi... |
0a63d4d8c839c823ecff2e18e8653029a8f943712e397738ce615a3bdcc89c8b | ucsd-progsys/liquidhaskell | Env.hs | {-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE NoMonomorphismRestriction #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ImplicitParams #-}
{-# LANGUAGE PartialTypeSignatur... | null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/e6c426db599f2cda431a4258a2ef8ec00612abd3/src/Language/Haskell/Liquid/Constraint/Env.hs | haskell | # LANGUAGE ScopedTypeVariables #
# LANGUAGE OverloadedStrings #
# LANGUAGE ImplicitParams #
# LANGUAGE PartialTypeSignatures #
| This module defines the representation for Environments needed
during constraint generation.
* Insert
, (++=)
* Construction
TODO: remove this ASAP
* Que... | # LANGUAGE NoMonomorphismRestriction #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module Language.Haskell.Liquid.Constraint.Env (
(+++=)
, (+=)
, extendEnvWithVV
, addBinders
, addSEnv
, addEEnv
, (-=)
, globalize
, fro... |
88460595a2616d0add4c0c343de0b0f8e219c59581388136e1d6c179a483a723 | PLTools/GT | test807showT.ml | let id x = x
let show_typed_string = Printf.sprintf "\"%s\""
module AL : sig
type ('a,'b) alist = Nil | Cons of 'a * 'b
[@@deriving gt ~show ~show_typed ~gmap ]
end = struct
type ('a,'b) alist = Nil | Cons of 'a * 'b
[@@deriving gt ~show ~show_typed ~gmap ]
end
let () =
let open AL in
let sh xs = show_... | null | https://raw.githubusercontent.com/PLTools/GT/62d1a424a3336f2317ba67e447a9ff09d179b583/regression_ppx/test807showT.ml | ocaml | Now let's try show_typed for mutal recursion | let id x = x
let show_typed_string = Printf.sprintf "\"%s\""
module AL : sig
type ('a,'b) alist = Nil | Cons of 'a * 'b
[@@deriving gt ~show ~show_typed ~gmap ]
end = struct
type ('a,'b) alist = Nil | Cons of 'a * 'b
[@@deriving gt ~show ~show_typed ~gmap ]
end
let () =
let open AL in
let sh xs = show_... |
ae1721ff98c32ac8d6b38b6ac56ea11bfcd024148547f013e9e802b55e46a092 | johnwhitington/ocamli | references.ml | Swap the contents of two references
let x = ref 0 in
let y = ref 1 in
let t = !x in
x := !y;
y := t
| null | https://raw.githubusercontent.com/johnwhitington/ocamli/28da5d87478a51583a6cb792bf3a8ee44b990e9f/examples/references.ml | ocaml | Swap the contents of two references
let x = ref 0 in
let y = ref 1 in
let t = !x in
x := !y;
y := t
| |
e3a22229d84c157b9ade1843fdcd7b6966f115128c284d87cc0c2ea1d9f7b727 | haskell/cabal | cabal.test.hs | import Test.Cabal.Prelude
Uknown arch name .
main = cabalTest $
fails $ cabal "check" []
| null | https://raw.githubusercontent.com/haskell/cabal/1cfe7c4c7257aa7ae450209d34b4a359e6703a10/cabal-testsuite/PackageTests/Check/NonConfCheck/Conditionals/UnknownArch/cabal.test.hs | haskell | import Test.Cabal.Prelude
Uknown arch name .
main = cabalTest $
fails $ cabal "check" []
| |
39fd9e0310259f37dac0c925dca0540bbf6f98c84525a895acee8a4eb1eb96d0 | justinmeiners/exercises | get.scm | ; -do-i-get-the-functions-put-and-get-in-sicp-scheme-exercise-2-78-and-on
(define global-array '())
(define (make-entry k v) (list k v))
(define (key entry) (car entry))
(define (value entry) (cadr entry))
(define (put op type item)
(define (put-helper k array)
(cond ((null? array) (list (make-entry k item)))
... | null | https://raw.githubusercontent.com/justinmeiners/exercises/9491bc16925eae12e048ccd3f424b870ebdc73aa/sicp/2/get.scm | scheme | -do-i-get-the-functions-put-and-get-in-sicp-scheme-exercise-2-78-and-on | (define global-array '())
(define (make-entry k v) (list k v))
(define (key entry) (car entry))
(define (value entry) (cadr entry))
(define (put op type item)
(define (put-helper k array)
(cond ((null? array) (list (make-entry k item)))
((equal? (key (car array)) k) array)
(else (cons (car a... |
940ea6bf36c0027496f557394971a570a21268ad3066b8c3526dea96113f24dd | agda/agda2hs | Importer.hs | module Importer where
import Importee (Foo(MkFoo), Fooable(doTheFoo), foo, (!#))
import SecondImportee (anotherFoo)
bar :: Int
bar = foo
baz :: Int
baz = 21 !# 21
myFoo :: Foo
myFoo = MkFoo
myOtherFoo :: Foo
myOtherFoo = doTheFoo
otherBar :: Int
otherBar = anotherFoo
| null | https://raw.githubusercontent.com/agda/agda2hs/1460f0cef975dbaa2dd743fcb8585db57cbf30e8/test/golden/Importer.hs | haskell | module Importer where
import Importee (Foo(MkFoo), Fooable(doTheFoo), foo, (!#))
import SecondImportee (anotherFoo)
bar :: Int
bar = foo
baz :: Int
baz = 21 !# 21
myFoo :: Foo
myFoo = MkFoo
myOtherFoo :: Foo
myOtherFoo = doTheFoo
otherBar :: Int
otherBar = anotherFoo
| |
696c83d1ccd5749729791a2122f0f8a0cbb229e792030bf4d4f622d295a06ee0 | kanaka/bartender | generator.clj | (ns rend.generator
(:require [clojure.string :as string]
[clojure.test.check.generators :as gen]
[instacheck.util :as util]
[html5-css3-ebnf.html-mangle :as html-mangle]
[rend.css3-generators :as css3-gen]
[rend.html5-generators :as html5-gen]))
(defn esca... | null | https://raw.githubusercontent.com/kanaka/bartender/4357fde74adb228a3cd3fcc12cae4926da899b4e/src/rend/generator.clj | clojure | Pull out css-assignments and do double-quote escaping
of strings in it so that the result can be inserted into
a style="" tag (which is already surrounded by double
quotes) | (ns rend.generator
(:require [clojure.string :as string]
[clojure.test.check.generators :as gen]
[instacheck.util :as util]
[html5-css3-ebnf.html-mangle :as html-mangle]
[rend.css3-generators :as css3-gen]
[rend.html5-generators :as html5-gen]))
(defn esca... |
262fd0cbdf4c950aa741b766d6fced3084d23793de8455b834a4fb953f4b6592 | sgbj/MaximaSharp | pregexp.lisp |
;; copyright notice:
;;
The following statement could be found today ( 08 - 03 - 15 ) on
;;
Here are some Scheme- and Common - Lisp - related items .
;; Everything presented here is freely distributable and freely usable, and comes with no warranty of any kind.
FS ( as in GPL , LGPL ) bundlers who require... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/share/stringproc/pregexp.lisp | lisp | copyright notice:
Everything presented here is freely distributable and freely usable, and comes with no warranty of any kind.
Others should find my COPYING file adequate.
All rights reserved.
Permission to copy, modify, distribute, and use this work or
a modified copy of this work, for any purpose, is her... |
The following statement could be found today ( 08 - 03 - 15 ) on
Here are some Scheme- and Common - Lisp - related items .
FS ( as in GPL , LGPL ) bundlers who require a standard license may use the LGPL to bundle any of these items .
COPYING file from ( ) :
Copyright ( c ) 1999 - 2005 , .
The re... |
d50c5d245bea6ed4dee18c764b800025832073f0cc12cc0e25a0ada1e28d0d5f | tanakh/ICFP2011 | Mami103.hs | {-# OPTIONS -Wall #-}
import Control.Applicative
import qualified Control.Exception.Control as E
import Control.Monad
import Data.List
import Data.Maybe
import Control.Monad.Trans
import LTG
import LTG.SoulGems
import System.Environment
getFirstWorthEnemy :: Int -> LTG (Maybe Int)
getFirstWorthEnemy dmg = do
alives... | null | https://raw.githubusercontent.com/tanakh/ICFP2011/db0d670cdbe12e9cef4242d6ab202a98c254412e/ai/Mami103.hs | haskell | # OPTIONS -Wall #
f1, f2, f3: temp
f4, f5
target: zombie target
next = v[f2] <- S (lazy_apply Copy f4) succ
f = v[f4] <- S (lazy_apply Copy f5) I
S (S help I) (S (K copy) (K 6))
num f1 f5
clear f4
f4 $< Copy
lazyApply f4 f1
S $> f4
f4 $< I
v[f4] <- S f next
v[f1] <- S (lazyApply Copy f4) (lazyApp... | import Control.Applicative
import qualified Control.Exception.Control as E
import Control.Monad
import Data.List
import Data.Maybe
import Control.Monad.Trans
import LTG
import LTG.SoulGems
import System.Environment
getFirstWorthEnemy :: Int -> LTG (Maybe Int)
getFirstWorthEnemy dmg = do
alives <- filterM
... |
82470c977c0476a6f8e6ac079f590a8d2dd0ca00a0e2e994f37e0696c4f787b4 | camlp5/pa_ppx_ag | ag_types.ml | (* camlp5r *)
(* ag_types.ml,v *)
open Asttools;
open MLast;
open Pa_ppx_base ;
open Pa_passthru ;
open Ppxutil ;
open Surveil ;
open Pa_deriving_base ;
open Pa_ppx_utils ;
module LMap : sig
type t 'a 'b = 'c;
value assoc : ?cmp:('a -> 'a -> bool) -> 'a -> t 'a 'b -> 'b ;
value mem : ?cmp:('a -> 'a -> bool) -> ... | null | https://raw.githubusercontent.com/camlp5/pa_ppx_ag/17ced795ab353ec8daaae53445ca96449f359df5/pa_ag/ag_types.ml | ocaml | camlp5r
ag_types.ml,v
parent.cattr := parent. cattr
parent.cattr := (last_child|parent). cattr |
open Asttools;
open MLast;
open Pa_ppx_base ;
open Pa_passthru ;
open Ppxutil ;
open Surveil ;
open Pa_deriving_base ;
open Pa_ppx_utils ;
module LMap : sig
type t 'a 'b = 'c;
value assoc : ?cmp:('a -> 'a -> bool) -> 'a -> t 'a 'b -> 'b ;
value mem : ?cmp:('a -> 'a -> bool) -> 'a -> t 'a 'b -> bool ;
value of... |
123ab0404037c1cf0838d23e512cd396f5b105801c8f78b93c1db1b68ceb8181 | rescript-lang/rescript-compiler | js_null_undefined.mli | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* 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 ) any later... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/c3fcc430360079546a6aabd2b2770303480f8486/jscomp/others/js_null_undefined.mli | ocaml | * Contains functionality for dealing with values that can be both `null` and `undefined`
* Returns `true` if the given value is null or undefined, `false` otherwise.
*
Maps `Js.null_undefined('a)` to `option('a)`.
`a` => `Some(a)`
`undefined` => `None`
`null` => `None`
| Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* 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 ) any later... |
30d1ca46d5912174617dda86fed00c3bb4c82c4b152def8dc141d4b4ab7a45fd | potapenko/playphraseme-site | model.cljs | (ns playphraseme.views.search.model
(:require [re-frame.core :refer [dispatch reg-event-db reg-sub]]
[playphraseme.common.localstorage :refer [model-store-md]]
[playphraseme.common.util :as util]
[cljs.core.async :as async :refer [<! >! put! chan timeout]])
(:require-macros
[c... | null | https://raw.githubusercontent.com/potapenko/playphraseme-site/d50a62a6bc8f463e08365dca96b3a6e5dde4fb12/src/cljs/playphraseme/views/search/model.cljs | clojure | (ns playphraseme.views.search.model
(:require [re-frame.core :refer [dispatch reg-event-db reg-sub]]
[playphraseme.common.localstorage :refer [model-store-md]]
[playphraseme.common.util :as util]
[cljs.core.async :as async :refer [<! >! put! chan timeout]])
(:require-macros
[c... | |
eb3161402c362ab3527ccce02380824a4aff6a15a76f059d6b7536196f63845d | jdevuyst/termcat | ast.cljs | (ns termcat.rules.ast
(:require-macros [termcat.core-macros-cljs :refer (defrule)])
(:require
[termcat.rewrite :as rw]
[termcat.term :as t]))
(defn- pop-n [coll n]
(subvec coll 0 (- (count coll) n)))
(defn- last-n [coll n]
(subvec col... | null | https://raw.githubusercontent.com/jdevuyst/termcat/5b4d89da67de89e6d62933c8c407e7a79ffdb0cb/doc/js/termcat/rules/ast.cljs | clojure | (ns termcat.rules.ast
(:require-macros [termcat.core-macros-cljs :refer (defrule)])
(:require
[termcat.rewrite :as rw]
[termcat.term :as t]))
(defn- pop-n [coll n]
(subvec coll 0 (- (count coll) n)))
(defn- last-n [coll n]
(subvec col... | |
3b457e6617593a235bcb3a89b08a2964bee0f7d089ecdc70b481ba0afb02e4f2 | comby-tools/comby | discover.ml | module C = Configurator.V1
let () =
C.main ~name:"zip" (fun c ->
let stale_gzip : C.Pkg_config.package_conf = {
libs = [ "-lz" ];
cflags = []
} in
let conf =
match C.Pkg_config.get c with
| None -> C.die "'pkg-config' missing"
| Some pc ->
match (C.Pkg_config.query pc ~package:"zlib") with
| None -... | null | https://raw.githubusercontent.com/comby-tools/comby/fa71ea540855ba5bd48d948dd8c8ff034714348d/lib/app/vendored/camlzip/config/discover.ml | ocaml | module C = Configurator.V1
let () =
C.main ~name:"zip" (fun c ->
let stale_gzip : C.Pkg_config.package_conf = {
libs = [ "-lz" ];
cflags = []
} in
let conf =
match C.Pkg_config.get c with
| None -> C.die "'pkg-config' missing"
| Some pc ->
match (C.Pkg_config.query pc ~package:"zlib") with
| None -... | |
ee464706182493d71dacad722f9d6dc56c5f374e138f8a44b3a7e18ef456b4c1 | ocaml/ocaml | test_caml_stubs_gc.ml | (* TEST
include runtime_events
*)
open Runtime_events
let got_minor = ref false
let () =
start ();
let cursor = create_cursor None in
let runtime_begin domain_id ts phase =
match phase with
| EV_MINOR ->
Gc.full_major ();
got_minor := true
| _ -> () in
let callbacks =... | null | https://raw.githubusercontent.com/ocaml/ocaml/ab544472480452e600eebf1f072970d5b71d7fb2/testsuite/tests/lib-runtime-events/test_caml_stubs_gc.ml | ocaml | TEST
include runtime_events
| open Runtime_events
let got_minor = ref false
let () =
start ();
let cursor = create_cursor None in
let runtime_begin domain_id ts phase =
match phase with
| EV_MINOR ->
Gc.full_major ();
got_minor := true
| _ -> () in
let callbacks = Callbacks.create ~runtime_begin (... |
3b5c6bd2ca350a996c895e9ab59bdcb7c5d628b07dc619e608a452721b2ee717 | arcfide/oleg | env.scm | ; The Environment
;
The environment is like a " database " ( or soup in NewtonScript ) .
; It does *not* follow any static scope of Scheme expressions, nor a
; dynamic scope of Scheme procedure activations. It's just a
; (hierarchical) repository that any procedure may deposit things
; into, or request values asso... | null | https://raw.githubusercontent.com/arcfide/oleg/c6826870436925fd4c873c01d7fcc24a7a7f95dc/ssax/lib/env.scm | scheme | The Environment
It does *not* follow any static scope of Scheme expressions, nor a
dynamic scope of Scheme procedure activations. It's just a
(hierarchical) repository that any procedure may deposit things
into, or request values associated with a name (a key-symbol)
The values associated with names are gene... | The environment is like a " database " ( or soup in NewtonScript ) .
Executes the THUNK in an environment extended by the CAPTURED - ENV .
THUNK is returned
environment rather than extends it . Again , after the THUNK is over , the
procedure : env.->alist
first time / every time the slots is accessed ( vi... |
5d8715e652cc0afeeb30758d6b7594bf72c2f565de846f1eff2ce3905ee12f79 | mukul-rathi/bolt | type_linear_capabilities.mli | (** This module type-checks potential accesses to linear capabilities of objects *)
open Core
open Desugaring.Desugared_ast
open Ast.Ast_types
val type_linear_obj_method_args :
class_defn list
-> Var_name.t
-> Class_name.t
-> identifier list
-> loc
-> unit Or_error.t
(** Checks that linear objects are ... | null | https://raw.githubusercontent.com/mukul-rathi/bolt/1faf19d698852fdb6af2ee005a5f036ee1c76503/src/frontend/data_race_checker/type_linear_capabilities.mli | ocaml | * This module type-checks potential accesses to linear capabilities of objects
* Checks that linear objects are not passed as arguments to their methods.
* Checks that linear arguments are not duplicated in function calls. |
open Core
open Desugaring.Desugared_ast
open Ast.Ast_types
val type_linear_obj_method_args :
class_defn list
-> Var_name.t
-> Class_name.t
-> identifier list
-> loc
-> unit Or_error.t
val type_linear_args : class_defn list -> identifier list -> loc -> unit Or_error.t
val type_linear_capabilities_bloc... |
6c5c05744dcadcf5dff65c63572789cbe49bbda10b937f70c8bd9931ac34c54a | wilbowma/cur | list.rkt | #lang cur
(require
cur/stdlib/sugar
cur/stdlib/bool
cur/stdlib/nat
cur/stdlib/maybe
cur/stdlib/list
rackunit/turnstile+)
(check-type (nil Nat) : (List Nat) -> (nil Nat))
(check-not-type (nil Nat) : (List Bool))
(check-type (cons Bool true (nil Bool)) : (List Bool))
(check-type (build-list Nat) : (List Nat) -> ... | null | https://raw.githubusercontent.com/wilbowma/cur/e039c98941b3d272c6e462387df22846e10b0128/cur-test/cur/tests/stdlib/list.rkt | racket | list-ref
list-ref: non-full applications
list-append: non-full applications | #lang cur
(require
cur/stdlib/sugar
cur/stdlib/bool
cur/stdlib/nat
cur/stdlib/maybe
cur/stdlib/list
rackunit/turnstile+)
(check-type (nil Nat) : (List Nat) -> (nil Nat))
(check-not-type (nil Nat) : (List Bool))
(check-type (cons Bool true (nil Bool)) : (List Bool))
(check-type (build-list Nat) : (List Nat) -> ... |
1421535454dcc990ab980caf0909a3133056ae2b073e85cb6cd998b0ec8d0eea | amalloy/aoc-2021 | Main.hs | # LANGUAGE ApplicativeDo , DeriveFunctor , , DeriveTraversable #
module Main where
import Text.Regex.Applicative ( sym, Alternative(many), RE, (=~), psym )
import Control.Arrow ((&&&))
import Text.Regex.Applicative.Common (decimal)
import Data.Maybe (fromJust, isNothing, catMaybes)
import Data.Foldable (toList)
imp... | null | https://raw.githubusercontent.com/amalloy/aoc-2021/901eecf8971897b6906cdf174705187235b35349/day04/src/Main.hs | haskell | # LANGUAGE ApplicativeDo , DeriveFunctor , , DeriveTraversable #
module Main where
import Text.Regex.Applicative ( sym, Alternative(many), RE, (=~), psym )
import Control.Arrow ((&&&))
import Text.Regex.Applicative.Common (decimal)
import Data.Maybe (fromJust, isNothing, catMaybes)
import Data.Foldable (toList)
imp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.