_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 |
|---|---|---|---|---|---|---|---|---|
524fe4f1c3737670c044ea4407d4635a1ecb801ac4de7fafb5a26870f1821e52 | ocaml/ocaml | pr4466.ml | (* TEST
* hassysthreads
include systhreads
** native
*)
open Printf
Regression test for PR#4466 : select timeout with simultaneous read
and write on socket in Windows .
and write on socket in Windows. *)
(* Scenario:
- thread [server] implements a simple 'echo' server on a socket
- thread [rea... | null | https://raw.githubusercontent.com/ocaml/ocaml/55da58ca6c9144331c7fa56a5d0083cb97b50925/testsuite/tests/lib-threads/pr4466.ml | ocaml | TEST
* hassysthreads
include systhreads
** native
Scenario:
- thread [server] implements a simple 'echo' server on a socket
- thread [reader] selects then reads from a socket connected to
the echo server and copies to standard output
- main program executes [writer], which writes to the same... |
open Printf
Regression test for PR#4466 : select timeout with simultaneous read
and write on socket in Windows .
and write on socket in Windows. *)
let server sock =
let (s, _) = Unix.accept sock in
let buf = Bytes.make 1024 '>' in
for i = 1 to 3 do
let n = Unix.recv s buf 2 (Bytes.length buf - ... |
007ba6a25419c92a95f331fbd04537ba36e1f7c648141aa91151ddf5a54d1e13 | google/codeworld | Matcher.hs | # LANGUAGE FlexibleInstances #
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ViewPatterns #
Copyright 2020 The CodeWorld Authors . All rights reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the Li... | null | https://raw.githubusercontent.com/google/codeworld/77b0863075be12e3bc5f182a53fcc38b038c3e16/codeworld-compiler/src/CodeWorld/Compile/Requirements/Matcher.hs | haskell | # LANGUAGE PackageImports #
# LANGUAGE RankNTypes # | # LANGUAGE FlexibleInstances #
# LANGUAGE ViewPatterns #
Copyright 2020 The CodeWorld Authors . 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
... |
6a7111f550c65ab40a8bf37c29653f4cca809c215dc4b9b76ccd45b9c7a05d6b | expipiplus1/vulkan | XR_MSFT_hand_tracking_mesh.hs | {-# language CPP #-}
-- | = Name
--
-- XR_MSFT_hand_tracking_mesh - instance extension
--
-- = Specification
--
-- See
-- <#XR_MSFT_hand_tracking_mesh XR_MSFT_hand_tracking_mesh>
-- in the main specification for complete information.
--
-- = Registered Extension Number
--
53
--
-- = Revision
--
2
--
-- = Extension... | null | https://raw.githubusercontent.com/expipiplus1/vulkan/ebc0dde0bcd9cf251f18538de6524eb4f2ab3e9d/openxr/src/OpenXR/Extensions/XR_MSFT_hand_tracking_mesh.hs | haskell | # language CPP #
| = Name
XR_MSFT_hand_tracking_mesh - instance extension
= Specification
See
<#XR_MSFT_hand_tracking_mesh XR_MSFT_hand_tracking_mesh>
in the main specification for complete information.
= Registered Extension Number
= Revision
= Extension and Version Dependencies
- Requires @XR_E... | 53
2
- Requires OpenXR 1.0
' HandMeshVertexBufferMSFT ' , ' HandMeshVertexMSFT ' ,
' HandPoseTypeInfoMSFT ' , ' HandPoseTypeMSFT ' ,
' SystemHandTrackingMeshPropertiesMSFT ' , ' createHandMeshSpaceMSFT ' ,
module OpenXR.Extensions.XR_MSFT_hand_tracking_mesh ( createHandMeshSpaceMSFT
... |
8c2cbf511221c260417e6c0df70dce11c54186723cf59e3a0e1a0913ad5e0d99 | openvstorage/alba | maintenance_config.ml |
Copyright ( C ) iNuron -
This file is part of Open vStorage . For license information , see < LICENSE.txt >
Copyright (C) iNuron -
This file is part of Open vStorage. For license information, see <LICENSE.txt>
*)
open! Prelude
type redis_lru_cache_eviction = {
host : string;
port : int;
ke... | null | https://raw.githubusercontent.com/openvstorage/alba/459bd459335138d6b282d332fcff53a1b4300c29/ocaml/src/maintenance_config.ml | ocaml |
Copyright ( C ) iNuron -
This file is part of Open vStorage . For license information , see < LICENSE.txt >
Copyright (C) iNuron -
This file is part of Open vStorage. For license information, see <LICENSE.txt>
*)
open! Prelude
type redis_lru_cache_eviction = {
host : string;
port : int;
ke... | |
ee6727ac0d27d9e6d44199a7ed88ff86bf02700cdf7c18bfdb61f81b9e9d4689 | chetmurthy/pa_ppx | pp_MLast.ml | module Ploc =
struct
include Ploc;
value pp0_loc ppf loc =
let fname = Ploc.file_name loc in
let line = Ploc.line_nb loc in
let bp = Ploc.first_pos loc in
let ep = Ploc.last_pos loc in
let bol = Ploc.bol_pos loc in
let bp = bp - bol + 1 in
let ep = ep - bol + 1 in
... | null | https://raw.githubusercontent.com/chetmurthy/pa_ppx/7c662fcf4897c978ae8a5ea230af0e8b2fa5858b/base/pp_MLast.ml | ocaml | module Ploc =
struct
include Ploc;
value pp0_loc ppf loc =
let fname = Ploc.file_name loc in
let line = Ploc.line_nb loc in
let bp = Ploc.first_pos loc in
let ep = Ploc.last_pos loc in
let bol = Ploc.bol_pos loc in
let bp = bp - bol + 1 in
let ep = ep - bol + 1 in
... | |
50c128b3b549aa28a57a0c5ff89b8e491363b692c6580cc4ecd9e0c38651e5cb | raimohanska/rump | StringBuffer.hs | module Util.StringBuffer(StringBuffer, newSB, appendSB, readSB) where
import Data.IORef
import Control.Monad
data StringBuffer = StringBuffer (IORef [String])
newSB = liftM StringBuffer $ newIORef []
appendSB sb s = modifyIORef sb (s :)
readSB = readIORef >=> return . concat
| null | https://raw.githubusercontent.com/raimohanska/rump/f64c95fe80bb37dedb3f55627c3450c878c66e80/src/Util/StringBuffer.hs | haskell | module Util.StringBuffer(StringBuffer, newSB, appendSB, readSB) where
import Data.IORef
import Control.Monad
data StringBuffer = StringBuffer (IORef [String])
newSB = liftM StringBuffer $ newIORef []
appendSB sb s = modifyIORef sb (s :)
readSB = readIORef >=> return . concat
| |
ce80a4cf8c950216285d523b5474e410f1d40e8c517863edd7e157ba10c6887b | nixeagle/nisp | beta.lisp | (in-package :nisp.i)
(define-simple-command beta
(network-tree::next-node))
(defun shorturl-is.gd (string)
(declare (type string string))
(drakma:http-request ""
:parameters `(("longurl" . ,string))))
(define-simple-command beta-shorturl
(reply (shorturl-is.gd (remaining-parameters)))... | null | https://raw.githubusercontent.com/nixeagle/nisp/680b40b3b9ea4c33db0455ac73cbe3756afdbb1e/irc-bot/commands/beta.lisp | lisp | (in-package :nisp.i)
(define-simple-command beta
(network-tree::next-node))
(defun shorturl-is.gd (string)
(declare (type string string))
(drakma:http-request ""
:parameters `(("longurl" . ,string))))
(define-simple-command beta-shorturl
(reply (shorturl-is.gd (remaining-parameters)))... | |
3ce17410623b3234357c3fbb96b2952ec824950e1f2476af9308ac93c0cd64e0 | elisehuard/game-in-haskell | Main.hs | import Testing.Sound
import Testing.Backend
import Testing.Graphics
import Testing.Game
import Testing.CommandLine
import System.Exit ( exitSuccess )
import System.Random
import Control.Concurrent (threadDelay)
import Control.Monad (unless, join, when)
import Control.Monad.Fix (fix)
import FRP.Elerea.Simple as Elerea
... | null | https://raw.githubusercontent.com/elisehuard/game-in-haskell/b755c42d63ff5dc9246b46590fb23ebcc1d455b1/src/Testing/Main.hs | haskell | import Testing.Sound
import Testing.Backend
import Testing.Graphics
import Testing.Game
import Testing.CommandLine
import System.Exit ( exitSuccess )
import System.Random
import Control.Concurrent (threadDelay)
import Control.Monad (unless, join, when)
import Control.Monad.Fix (fix)
import FRP.Elerea.Simple as Elerea
... | |
a80a24f50bf3c907e42d28c67460e7b3f0a6d9e9defeba76a71f92c058dbf020 | okuoku/nausicaa | compile-all.ypsilon.sps | ;;;
Part of : /
Contents : compile script for Ypsilon Scheme
Date : Sat Dec 26 , 2009
;;;
;;;Abstract
;;;
;;;
;;;
Copyright ( c ) 2009 < >
;;;
;;;This program is free software: you can redistribute it and/or modify
;;;it under the terms of the GNU General Public License as published by
the Free Software Foundati... | null | https://raw.githubusercontent.com/okuoku/nausicaa/50e7b4d4141ad4d81051588608677223fe9fb715/gcrypt/src/libraries/compile-all.ypsilon.sps | scheme |
Abstract
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warra... | Part of : /
Contents : compile script for Ypsilon Scheme
Date : Sat Dec 26 , 2009
Copyright ( c ) 2009 < >
the Free Software Foundation , either version 3 of the License , or ( at
General Public License for more details .
You should have received a copy of the GNU General Public License
(import
(only ... |
d23e753b13519b0eac69817effb2079df8bdfa0be8ba5fe3c1faaa88ba7062ba | cyga/real-world-haskell | add.hs | -- file: ch03/add.hs
myNot True = False
myNot False = True
-- file: ch03/add.hs
sumList (x:xs) = x + sumList xs
sumList [] = 0
| null | https://raw.githubusercontent.com/cyga/real-world-haskell/4ed581af5b96c6ef03f20d763b8de26be69d43d9/ch03/add.hs | haskell | file: ch03/add.hs
file: ch03/add.hs | myNot True = False
myNot False = True
sumList (x:xs) = x + sumList xs
sumList [] = 0
|
0eb36fbdc822d3619a8535a6be76de75e281da6be569a047e9821eefeb0e30ee | UU-ComputerScience/uhc | Numeric.hs | # LANGUAGE CPP #
# OPTIONS_GHC -XNoImplicitPrelude #
-----------------------------------------------------------------------------
-- |
-- Module : Numeric
Copyright : ( c ) The University of Glasgow 2002
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
-- Stability... | null | https://raw.githubusercontent.com/UU-ComputerScience/uhc/f2b94a90d26e2093d84044b3832a9a3e3c36b129/EHC/ehclib/base/Numeric.hs | haskell | ---------------------------------------------------------------------------
|
Module : Numeric
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : provisional
Portability : portable
Odds and ends, mostly functions for reading and showing
'RealFloat'-like kind ... | # LANGUAGE CPP #
# OPTIONS_GHC -XNoImplicitPrelude #
Copyright : ( c ) The University of Glasgow 2002
Adapted for EHC
module Numeric (
: : Integral a = > a - > ( a - > ) - > a - > ShowS
: : ( Integral a ) = > a - > ( Bool )
#ifndef __UHC__
#endif
) where
#ifdef __GLASGOW_HASKEL... |
59a47aafa886b0c27aa9d6ec999597f1403e90a49469708e45eb6b204d24b41e | 8c6794b6/haskell-sc-scratch | WatchYourStep.hs | ------------------------------------------------------------------------------
-- |
-- Module : $Header$
-- License : BSD3
Maintainer :
-- Stability : unstable
-- Portability : non-portable
--
module LearnYour.Zipper.WatchYourStep where
import LearnYour.Zipper.Tree
import LearnYour.Zipper.Scratch (Crum... | null | https://raw.githubusercontent.com/8c6794b6/haskell-sc-scratch/22de2199359fa56f256b544609cd6513b5e40f43/Scratch/LearnYour/Zipper/WatchYourStep.hs | haskell | ----------------------------------------------------------------------------
|
Module : $Header$
License : BSD3
Stability : unstable
Portability : non-portable
| Maintainer :
module LearnYour.Zipper.WatchYourStep where
import LearnYour.Zipper.Tree
import LearnYour.Zipper.Scratch (Crumb(..), Zipper)
goLeft :: Zipper a -> Maybe (Zipper a)
goLeft (Node x l r, bs) = Just (l, LeftCrumb x r:bs)
goLeft _ = Nothing
goRight :: Zipper a -> Maybe (Zipper a)
goRight ... |
4a5f2b6efb19874fe1fae534f548f3da4333d5cb9668fac3105277da14e1d657 | mattmundell/nightshade | build-world.lisp | ;;; Build all the Lisp code.
;;;
;;; Intended for a command like
;;;
;;; lisp -load src/tools/build-world.lisp
;;;
;;; or
;;;
;;; build-small/bin/lisp -core build-small/bin/lisp.core \
-eval " ( defvar user::src " ) " \
;;; -load src/tools/build-world.lisp
;;;
;;; The source and target director... | null | https://raw.githubusercontent.com/mattmundell/nightshade/68e960eff95e007462f2613beabc6cac11e0dfa1/src/tools/build-world.lisp | lisp | Build all the Lisp code.
Intended for a command like
lisp -load src/tools/build-world.lisp
or
build-small/bin/lisp -core build-small/bin/lisp.core \
-load src/tools/build-world.lisp
The source and target directories (variables src and target) are either
supplied or set to "./src" and "./build/... | -eval " ( defvar user::src " ) " \
(in-package "USER")
(defvar src "./src/"
"Location of the source.")
(defvar target (if src (format () "~A/../build/" src) "./build/")
"Destination directory for the build.")
(defvar systems '(:lisp :compiler :ed :kernel)
"A list of systems to build. Members of t... |
8de3db5756dc0502ec2a3a611b72c3e3e05273dbd07b877d103eb11dfe43570b | tamarin-prover/tamarin-prover | Unicode.hs | -- |
Copyright : ( c ) 2010
-- License : GPL v3 (see LICENSE)
--
Maintainer : < >
-- Portability : portable
--
Support functions for exploiting Unicode characters .
module Text.Unicode where
-- | Convert a subscriptable character to its subsript.
subscriptChar :: Char -> Char
subscriptChar c = cas... | null | https://raw.githubusercontent.com/tamarin-prover/tamarin-prover/c78c7afd3b93b52dd4d2884952ec0fc273832a0d/lib/utils/src/Text/Unicode.hs | haskell | |
License : GPL v3 (see LICENSE)
Portability : portable
| Convert a subscriptable character to its subsript.
FIXME: Add further characters from
#super
| Convert all subscriptable characters to subscripts. | Copyright : ( c ) 2010
Maintainer : < >
Support functions for exploiting Unicode characters .
module Text.Unicode where
subscriptChar :: Char -> Char
subscriptChar c = case c of
'0' -> '₀'
'1' -> '₁'
'2' -> '₂'
'3' -> '₃'
'4' -> '₄'
'5' -> '₅'
'6' -> '₆'
'7' -> '₇'
... |
58adda590fe8825740f5006d1dd5d4c81857d01c3f056a1e2aaded93d7da9a9c | DougHamil/threeagent | core.cljs | (ns threeagent.core
(:refer-clojure :exclude [atom])
(:require [threeagent.impl.scene :as scene]
[threeagent.impl.types :refer [Context]]
[reagent.ratom :as ratom]))
(def atom ratom/atom)
(def cursor ratom/cursor)
(def track ratom/track)
(defn render
"Renders the threeagent scene at the ... | null | https://raw.githubusercontent.com/DougHamil/threeagent/d1db04dc65845310f27dd3f7021be3a5b52140c2/src/main/threeagent/core.cljs | clojure | (ns threeagent.core
(:refer-clojure :exclude [atom])
(:require [threeagent.impl.scene :as scene]
[threeagent.impl.types :refer [Context]]
[reagent.ratom :as ratom]))
(def atom ratom/atom)
(def cursor ratom/cursor)
(def track ratom/track)
(defn render
"Renders the threeagent scene at the ... | |
aae8681cb6cc840d267e2f35b5a3c0862a71327e69b41ec205dc5f33b77c9144 | SumitPadhiyar/confuzz | lwt_afl_scheduler.mli | val fuzz : (unit -> unit) list -> unit
(* Fuzzes an array of functions *)
val get_fuzzed_calls : (unit -> 'a) list -> (unit -> 'a) list | null | https://raw.githubusercontent.com/SumitPadhiyar/confuzz/7d6b2af51d7135025f9ed1e013a9ae0940f3663e/src/core/lwt_afl_scheduler.mli | ocaml | Fuzzes an array of functions | val fuzz : (unit -> unit) list -> unit
val get_fuzzed_calls : (unit -> 'a) list -> (unit -> 'a) list |
385d28c61198d1723cbf1e5c41dc6112c014be341a6d317c2538ab9fa8ac9df5 | dcos/dcos-net | dcos_rest_lashup_handler.erl | %%%-------------------------------------------------------------------
@author sdhillon
( C ) 2016 , < COMPANY >
%%% @doc
%%%
%%% @end
Created : 24 . May 2016 9:34 PM
%%%-------------------------------------------------------------------
-module(dcos_rest_lashup_handler).
-author("sdhillon").
%% API
-export([
... | null | https://raw.githubusercontent.com/dcos/dcos-net/7bd01ac237ff4b9a12a020ed443e71c45f7063f4/apps/dcos_rest/src/dcos_rest_lashup_handler.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
Probably an IP address? | @author sdhillon
( C ) 2016 , < COMPANY >
Created : 24 . May 2016 9:34 PM
-module(dcos_rest_lashup_handler).
-author("sdhillon").
-export([
init/2,
content_types_provided/2,
allowed_methods/2,
content_types_accepted/2,
to_json/2,
perform_op/2
]).
init(Req, Opts) ->
{cowboy_rest, Req... |
7939ccce04e4a96ecdcf8ec58498076ac46551dbaadb08b4c6c5fe48fc37f44d | mauke/data-default | Base.hs |
Copyright ( c ) 2013
All rights reserved .
Redistribution and use in source and binary forms , with or without modification ,
are permitted provided that the following conditions are met :
* Redistributions of source code must retain the above copyright notice , this
list of conditions and the follo... | null | https://raw.githubusercontent.com/mauke/data-default/b1a08788ca3d6a714319726e3768cf93df92458e/data-default-instances-base/Data/Default/Instances/Base.hs | haskell | | This module reexports the 'Data.Default.Class.Default' instances from the |
Copyright ( c ) 2013
All rights reserved .
Redistribution and use in source and binary forms , with or without modification ,
are permitted provided that the following conditions are met :
* Redistributions of source code must retain the above copyright notice , this
list of conditions and the follo... |
ca7a1e26da31be75ead05843a09c6f37564bda4541943d6d1954bb23ddfd8852 | dgtized/shimmers | spaces_divided.cljs | (ns shimmers.sketches.spaces-divided
(:require
[quil.core :as q :include-macros true]
[quil.middleware :as m]
[shimmers.algorithm.polygon-detection :as poly-detect]
[shimmers.common.framerate :as framerate]
[shimmers.common.quil :as cq]
[shimmers.common.sequence :as cs]
[shimmers.common.ui.debug ... | null | https://raw.githubusercontent.com/dgtized/shimmers/f096c20d7ebcb9796c7830efcd7e3f24767a46db/src/shimmers/sketches/spaces_divided.cljs | clojure | improved but still showing backwards triangles form inset sometimes?
either inset or polygon detection is occasionally tossing in weird outputs
sometimes inset polygons self-intersect, so need to cut that part out
highlight points on hover + debug info
example of self intersect after inset operation | (ns shimmers.sketches.spaces-divided
(:require
[quil.core :as q :include-macros true]
[quil.middleware :as m]
[shimmers.algorithm.polygon-detection :as poly-detect]
[shimmers.common.framerate :as framerate]
[shimmers.common.quil :as cq]
[shimmers.common.sequence :as cs]
[shimmers.common.ui.debug ... |
6dc06ad1cdd9dcb65e4cb6ddd0d0847581af36b4c63db8c641595d5977902c43 | phadej/trustee | CabalBuild.hs | module Trustee.CabalBuild (
urakkaCabal,
urakkaCabalRow,
CabalResult (..),
) where
import Control.Arrow (arr, (>>>), (|||))
import Control.Concurrent.STM (STM)
import Trustee.GHC
import Trustee.Monad
import Trustee.Options
import Peura
import Urakka
data CabalResult
= CabalResultPending... | null | https://raw.githubusercontent.com/phadej/trustee/ab714484b39b43795ff586d5f232fad911a05dfd/src/Trustee/CabalBuild.hs | haskell | ^ constraints
^ working directory
^ verify? | module Trustee.CabalBuild (
urakkaCabal,
urakkaCabalRow,
CabalResult (..),
) where
import Control.Arrow (arr, (>>>), (|||))
import Control.Concurrent.STM (STM)
import Trustee.GHC
import Trustee.Monad
import Trustee.Options
import Peura
import Urakka
data CabalResult
= CabalResultPending... |
12c80b70e9175b9dd10c21d81441c1c9b6a837a6d449a8eaa80edc88801b6e77 | chicken-mobile/chicken-sdl2-android-builder | gl.scm | ;;
chicken - sdl2 : CHICKEN Scheme bindings to Simple DirectMedia Layer 2
;;
Copyright © 2013 , 2015 - 2016 .
;; All rights reserved.
;;
;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions
;; are met:
;;
;; - Redistributions... | null | https://raw.githubusercontent.com/chicken-mobile/chicken-sdl2-android-builder/90ef1f0ff667737736f1932e204d29ae615a00c4/eggs/sdl2/lib/sdl2/gl.scm | scheme |
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- Redistributio... | chicken - sdl2 : CHICKEN Scheme bindings to Simple DirectMedia Layer 2
Copyright © 2013 , 2015 - 2016 .
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
COPYRIGHT HOLDER OR FOR ANY DIRECT ,
INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES
( INCLUDING , BUT N... |
c928b90b4996d1c0e6065a565a0c8263d0dabce1525f575e8058990f70fe0ea3 | domsj/orocksdb | rocks.ml | open Ctypes
open Foreign
open Rocks_common
type bigarray = Rocks_intf.bigarray
module Views = Views
exception OperationOnInvalidObject = Rocks_common.OperationOnInvalidObject
module WriteBatch = struct
module C = CreateConstructors_(struct let name = "writebatch" end)
include C
let clear =
foreign
... | null | https://raw.githubusercontent.com/domsj/orocksdb/36bd561f5cd75299b2bb5f8e707427626d4c9025/rocks.ml | ocaml | Ugly hack. Is there a better way to retrieve string from C? | open Ctypes
open Foreign
open Rocks_common
type bigarray = Rocks_intf.bigarray
module Views = Views
exception OperationOnInvalidObject = Rocks_common.OperationOnInvalidObject
module WriteBatch = struct
module C = CreateConstructors_(struct let name = "writebatch" end)
include C
let clear =
foreign
... |
8702dfe76d0f954c18d6d8ebfe800b39252026db567601fb4c1db80895cb51d0 | vagarenko/static-tensor | Vector.hs | # LANGUAGE DeriveGeneric #
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE BangPatterns #-}
module MatMul.Vector where
import Data.Vector.Unboxed
type Matrix4x4f = Vector Float
mkMat :: [Float] -> Matrix4x4f
mkMat xs@(_a:_b:_c:_d:_e:_f:_g:_h:_i:_j:_k:_l:_m:_n:_o:_p:_) = fromList xs
mkMat _ = error "Not enou... | null | https://raw.githubusercontent.com/vagarenko/static-tensor/8409d281707c23f3fe2028e926f1d4e8f7a9bc2d/bench/MatMul/Vector.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE BangPatterns # | # LANGUAGE DeriveGeneric #
module MatMul.Vector where
import Data.Vector.Unboxed
type Matrix4x4f = Vector Float
mkMat :: [Float] -> Matrix4x4f
mkMat xs@(_a:_b:_c:_d:_e:_f:_g:_h:_i:_j:_k:_l:_m:_n:_o:_p:_) = fromList xs
mkMat _ = error "Not enough elements for matrix."
mult :: Matrix4x4f -> Matrix4x4f -> ... |
1ce28762a83c95aa9a89fa65d2fed08a480f7233ac5dd0954e7744bf0d79d4b0 | clojure-dus/chess | piece_attacks.clj | (ns chess.movelogic.bitboard.piece-attacks
(:use [chess.movelogic.bitboard file-rank bitoperations]))
; pre-calculated move and attack arrays
(defn- create-vect-bitboards [moves-coords]
"creates a vector of 64 squares which have bitboards
in which moves-coords have been flaged "
(let [all-moves (f... | null | https://raw.githubusercontent.com/clojure-dus/chess/7eb0e5bf15290f520f31e7eb3f2b7742c7f27729/src/chess/movelogic/bitboard/piece_attacks.clj | clojure | pre-calculated move and attack arrays
--------------------------------------------------------------------
Pre-calculated attack and move arrays for each chess piece
--------------------------------------------------------------------
| (ns chess.movelogic.bitboard.piece-attacks
(:use [chess.movelogic.bitboard file-rank bitoperations]))
(defn- create-vect-bitboards [moves-coords]
"creates a vector of 64 squares which have bitboards
in which moves-coords have been flaged "
(let [all-moves (for [[square file rank] file-rank-squares
... |
cfaa3a8cbc8aff8ee392830dc913dfa311df022d6de4c21c27b71f4246c09d74 | Eonblast/Scalaxis | db_verify_use.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/src/db_verify_use.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(db_verify_use).
-author('').
-vsn('$Id$').
-include("scalaris.hrl").
-behaviour(db_beh).
-define(BASE_DB,... |
7f350bc363be31626bf5f29f4411c65c92913235754e114ab2acf766d6c0e77e | adacapo21/plutusPioneerProgram | FortyTwo.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
{-# LANGUAGE TypeOperators #-}
mo... | null | https://raw.githubusercontent.com/adacapo21/plutusPioneerProgram/d76d46ea72267a19d7ea91ae9b39cafcf08ac962/week02/src/Week02/FortyTwo.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeOperators # | # LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Week02.FortyTwo where
import Control.Monad hiding (fmap)
import Data.Map as Map
import Data.Tex... |
3cf9ba5927ca97cf4abf784f4a2a2a1a2845ee3c61709f1ce9d25774d167bedf | Zilliqa/scilla | DebugMessage.ml |
This file is part of scilla .
Copyright ( c ) 2018 - present Zilliqa Research Pvt . Ltd.
scilla 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 y... | null | https://raw.githubusercontent.com/Zilliqa/scilla/011323ac5da48ee16890b71424e057ffbc4216da/src/base/DebugMessage.ml | ocaml | Prints to log file
Prints to stdout and log file
Prints to stderr and log file
Prints to trace file, if set, else to stdout. |
This file is part of scilla .
Copyright ( c ) 2018 - present Zilliqa Research Pvt . Ltd.
scilla 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 y... |
274e54e4af0e62570f273e9f3c97915e2f66c8ec4fcec1309182c6e3a29dff13 | jordwalke/rehp | wiki_syntax.ml | Ocsimore
* Copyright ( C ) 2008
* Laboratoire PPS - Université Paris Diderot - CNRS
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
... | null | https://raw.githubusercontent.com/jordwalke/rehp/f122b94f0a3f06410ddba59e3c9c603b33aadabf/examples/wiki/wiki_syntax.ml | ocaml | Ocsimore
* Copyright ( C ) 2008
* Laboratoire PPS - Université Paris Diderot - CNRS
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation ; either version 2 of the License , or
... | |
51deb54fb84278acaee1ead5e65ee4fff24f7680194025211c86620b89885627 | donaldsonjw/bigloo | iterate.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / comptime / Cfa / iterate.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/donaldsonjw/bigloo/a4d06e409d0004e159ce92b9908719510a18aed5/comptime/Cfa/iterate.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* THE control flow analysis engine */
*===========================... | * serrano / prgm / project / bigloo / comptime / Cfa / iterate.scm * /
* Author : * /
* Creation : We d Feb 22 18:11:52 1995 * /
* Last change : Fri Nov 18 07:40:33 2011 ( serrano ) * /
* Cop... |
85a421a778c98545074a7c041e07d3bd4cbe0e64ac6eee7a38c726a093585ae2 | leksah/leksah | WebKitGtk.hs | module Main (main) where
import Data.Default (def)
import Language.Javascript.JSaddle.WebKitGTK as JSaddleWK (run)
import IDE.Web.Main (newIDE, startJSaddle)
main :: IO ()
main =
newIDE $ startJSaddle 3367 (\html url -> JSaddleWK.run)
| null | https://raw.githubusercontent.com/leksah/leksah/f4bb70b1b51682053e5532ab98cacdf248a7e632/main/WebKitGtk.hs | haskell | module Main (main) where
import Data.Default (def)
import Language.Javascript.JSaddle.WebKitGTK as JSaddleWK (run)
import IDE.Web.Main (newIDE, startJSaddle)
main :: IO ()
main =
newIDE $ startJSaddle 3367 (\html url -> JSaddleWK.run)
| |
543f8081e496c69eadd6a4dd1207f2161ddf08df37037947f44655b151c4a3db | blindglobe/clocc | h2lisp.lisp | # ! /usr / bin / clisp -M ~sds / bin / clisp.mem -C
;;;
Convert * .c to CLISP 's ffi
;;;
Copyright ( C ) 1999 - 2001 , 2007 - 2008 by
This is Free Software , covered by the GNU GPL ( v2 + )
;;; See
;;;
$ I d : h2lisp.lisp , v 2.10 2008/06/16 16:02:33 sds Exp $
;;; $Source: /cvsroot/clocc/clocc/src/cllib/h2li... | null | https://raw.githubusercontent.com/blindglobe/clocc/a50bb75edb01039b282cf320e4505122a59c59a7/src/cllib/h2lisp.lisp | lisp |
See
$Source: /cvsroot/clocc/clocc/src/cllib/h2lisp.lisp,v $
`text-stream'
C parsing
(loop :for line :of-type simple-string =
(concatenate 'string "#" (read-line stream))
:then (read-line stream)
:collect line)
#'read-standalone-char nil rt)
(defun uncomment-split (lst ob... | # ! /usr / bin / clisp -M ~sds / bin / clisp.mem -C
Convert * .c to CLISP 's ffi
Copyright ( C ) 1999 - 2001 , 2007 - 2008 by
This is Free Software , covered by the GNU GPL ( v2 + )
$ I d : h2lisp.lisp , v 2.10 2008/06/16 16:02:33 sds Exp $
(eval-when (:compile-toplevel :load-toplevel :execute)
(require :c... |
7264f7872a5a19c421cd68d91cc42a9d8ecda632688f2427bfeeb779fa1fc647 | NorfairKing/validity | EqSpec.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE TypeApplications #
module Test.Validity.EqSpec where
import Data.GenValidity
import GHC.Generics (Generic)
import Test.Hspec
import Test.Validity.Eq
import Test.Validity.Utils
spec :: Spec
spec = do
eqSpec @Rational
eqSpec @Int
eqSpec DOES NOT HOLD because of NaN
eqSpec... | null | https://raw.githubusercontent.com/NorfairKing/validity/35bc8d45b27e6c21429e4b681b16e46ccd541b3b/genvalidity-hspec/test/Test/Validity/EqSpec.hs | haskell | # LANGUAGE DeriveGeneric #
# LANGUAGE TypeApplications #
module Test.Validity.EqSpec where
import Data.GenValidity
import GHC.Generics (Generic)
import Test.Hspec
import Test.Validity.Eq
import Test.Validity.Utils
spec :: Spec
spec = do
eqSpec @Rational
eqSpec @Int
eqSpec DOES NOT HOLD because of NaN
eqSpec... | |
10e04b7e5ec128b5b361555e02fdfd59af6a717557b2b52e3ebe18f7130f9064 | coccinelle/coccinelle | unitary_ast0.ml |
* This file is part of Coccinelle , licensed under the terms of the GPL v2 .
* See copyright.txt in the Coccinelle source code for more information .
* The Coccinelle source code can be obtained at
* This file is part of Coccinelle, licensed under the terms of the GPL v2.
* See copyright.txt in the Cocci... | null | https://raw.githubusercontent.com/coccinelle/coccinelle/57cbff0c5768e22bb2d8c20e8dae74294515c6b3/parsing_cocci/unitary_ast0.ml | ocaml | find unitary metavariables
-----------------------------------------------------------------------
Find the variables that occur free and occur free in a unitary way
take everything
take only what is in the plus code
considers a single list
considers a list of lists
It seems that position variables are n... |
* This file is part of Coccinelle , licensed under the terms of the GPL v2 .
* See copyright.txt in the Coccinelle source code for more information .
* The Coccinelle source code can be obtained at
* This file is part of Coccinelle, licensed under the terms of the GPL v2.
* See copyright.txt in the Cocci... |
7ff00cd7094ece4989c73cbad2467c3de135fd7c94d1f9f993204516a9507f1e | ndmitchell/supero | queens.hs | -- !!! count the number of solutions to the "n queens" problem.
( grabbed from LML dist )
module Main(main) where
#if MAIN
main = print $ root 12
addInt'2 = (+) :: Int -> Int -> Int
subInt'2 = (-) :: Int -> Int -> Int
neqInt'2 = (/=) :: Int -> Int -> Bool
eqInt'2 = (==) :: Int -> Int -> Bool
gtInt'2 = (>) :: Int -... | null | https://raw.githubusercontent.com/ndmitchell/supero/a8b16ea90862e2c021bb139d7a7e9a83700b43b2/supero3/samples/nofib/queens.hs | haskell | !!! count the number of solutions to the "n queens" problem.
x /= q && x /= q+d && x /= q-d | ( grabbed from LML dist )
module Main(main) where
#if MAIN
main = print $ root 12
addInt'2 = (+) :: Int -> Int -> Int
subInt'2 = (-) :: Int -> Int -> Int
neqInt'2 = (/=) :: Int -> Int -> Bool
eqInt'2 = (==) :: Int -> Int -> Bool
gtInt'2 = (>) :: Int -> Int -> Bool
safer'3 x d q = x /= q && x /= q+d && x /= q-d
#... |
eacffe4cfe6a2ffd7b6cbe6b218ca50742b320882a36ca652b6289b27261b7ab | tailrecursion/cljson | cljson_test.clj | (ns tailrecursion.cljson-test
(:require [clojure.tools.reader.edn :as e]
[clojure.test :refer :all]
[cheshire.core :refer [generate-string parse-string]]
[tailrecursion.cljson :refer [encode decode clj->cljson cljson->clj]]
[clojure.data.generators :as g])
(:refer-clo... | null | https://raw.githubusercontent.com/tailrecursion/cljson/180c0c3ea49e13da965fecb23c2f8e55e0f14b69/test/tailrecursion/cljson_test.clj | clojure | benchmark | (ns tailrecursion.cljson-test
(:require [clojure.tools.reader.edn :as e]
[clojure.test :refer :all]
[cheshire.core :refer [generate-string parse-string]]
[tailrecursion.cljson :refer [encode decode clj->cljson cljson->clj]]
[clojure.data.generators :as g])
(:refer-clo... |
2b571fc750b00fd08f11a0f320bb2f313eda8383a55fcf58bb732ca10ef3309e | clj-easy/graalvm-clojure | main.clj | (ns simple.main
(:require [cljfmt.main :as fmt])
(:gen-class))
(defn -main [& args]
(apply fmt/-main args))
| null | https://raw.githubusercontent.com/clj-easy/graalvm-clojure/5de155ad4f95d5dac97aac1ab3d118400e7d186f/cljfmt/src/simple/main.clj | clojure | (ns simple.main
(:require [cljfmt.main :as fmt])
(:gen-class))
(defn -main [& args]
(apply fmt/-main args))
| |
f97ea5f88692e64ec349242593c23174c50b72d320267139d6bd2b7bd79a7a84 | EligiusSantori/L2Apf | return.scm | (module logic racket/base
(require
racket/contract
"../packet/game/client/return.scm"
(only-in "../system/connection.scm" send-packet)
)
(provide return)
(define (return connection [point 'return-point/town])
(send-packet connection (game-client-packet/return point))
)
)
| null | https://raw.githubusercontent.com/EligiusSantori/L2Apf/30ffe0828e8a401f58d39984efd862c8aeab8c30/api/return.scm | scheme | (module logic racket/base
(require
racket/contract
"../packet/game/client/return.scm"
(only-in "../system/connection.scm" send-packet)
)
(provide return)
(define (return connection [point 'return-point/town])
(send-packet connection (game-client-packet/return point))
)
)
| |
fdd00409672fb8d992bbf68f9ad9d2b35fe9ca73c692a779e76a6b4985a4e528 | eareese/htdp-exercises | 125-legal-sentences.rkt | Exercise 125 . Discriminate the legal from the illegal sentences :
;; (define-struct oops [])
This is legal , apparently there can be zero or more names inside the brackets .
( define - struct child [ parents date ] )
; This is legal. There is an opening paren, the keyword define-struct, a name `child`, then ... | null | https://raw.githubusercontent.com/eareese/htdp-exercises/a85ff3111d459dda0e94d9b463d01a09accbf9bf/part01-fixed-size-data/125-legal-sentences.rkt | racket | (define-struct oops [])
This is legal. There is an opening paren, the keyword define-struct, a name `child`, then a list of names `parents`, `dob`, and `date` inside the square brackets, followed by the closing paren.
Explain why the sentences are legal or illegal. | Exercise 125 . Discriminate the legal from the illegal sentences :
This is legal , apparently there can be zero or more names inside the brackets .
( define - struct child [ parents date ] )
( define - struct ( child person ) [ dob date ] )
illegal ? ? The name should not look like ` ( child person ) ` ,... |
6e249da251c1d616ed1d210c5573ea1c354cab94bbf915a4209b2d7dca6935a7 | blynn/compiler | Webby.hs | -- In-browser compiler.
module Main where
import Base
import Ast
import Map
import Typer
import RTS
import System
import WartsBytes
data StrLen = StrLen { _str :: String -> String, _len :: Int }
instance Monoid StrLen where
mempty = StrLen id 0
(StrLen s1 n1) <> (StrLen s2 n2) = StrLen (s1 . s2) (n1 + n2)
hexVal... | null | https://raw.githubusercontent.com/blynn/compiler/05f0c92d73b219fa245f164833c5d2345b897fbe/inn/Webby.hs | haskell | In-browser compiler.
Function section: for each export, declare a function of type () -> ()..
Export section: add each export.
Code section: for nth export, define a function calling rts_reduce([512 + 4*n])
Data section:
1048576 - 4: hp
0 locals. | module Main where
import Base
import Ast
import Map
import Typer
import RTS
import System
import WartsBytes
data StrLen = StrLen { _str :: String -> String, _len :: Int }
instance Monoid StrLen where
mempty = StrLen id 0
(StrLen s1 n1) <> (StrLen s2 n2) = StrLen (s1 . s2) (n1 + n2)
hexValue d
| d <= '9' = ord ... |
e8ed989f6329a637080e1e468a440f5f2f3ba980044ae12f244e7567f2fcad71 | purcell/adventofcode2016 | Day13.hs | module Main where
import AdventOfCode
import Data.Bits (popCount)
import Data.List (nub)
import Data.Tree (Tree)
import qualified Data.Tree as T
import Data.Set (Set)
import qualified Data.Set as S
type Coord = (Int, Int)
puzzleInput = 1350
isOpen :: Coord -> Bool
isOpen (x, y) = even $ bitsSet $ x * x + 3 * x + 2 ... | null | https://raw.githubusercontent.com/purcell/adventofcode2016/081f30de4ea6b939e6c3736d83836f4dd72ab9a2/src/Day13.hs | haskell | module Main where
import AdventOfCode
import Data.Bits (popCount)
import Data.List (nub)
import Data.Tree (Tree)
import qualified Data.Tree as T
import Data.Set (Set)
import qualified Data.Set as S
type Coord = (Int, Int)
puzzleInput = 1350
isOpen :: Coord -> Bool
isOpen (x, y) = even $ bitsSet $ x * x + 3 * x + 2 ... | |
d33c49d08e68b44666f4e263a06d9af9f96a01450131f6bcbf99042944319b8c | sharplispers/ironclad | dsa.lisp | ;;;; -*- mode: lisp; indent-tabs-mode: nil -*-
;;;; dsa.lisp -- implementation of the Digital Signature Algorithm
(in-package :crypto)
;;; class definitions
(defclass dsa-key ()
((group :initarg :group :reader group)))
(defclass dsa-public-key (dsa-key)
((y :initarg :y :reader dsa-key-y :type integer)))
(def... | null | https://raw.githubusercontent.com/sharplispers/ironclad/6cc4da8554558ee2e89ea38802bbf6d83100d4ea/src/public-key/dsa.lisp | lisp | -*- mode: lisp; indent-tabs-mode: nil -*-
dsa.lisp -- implementation of the Digital Signature Algorithm
class definitions
function definitions
Note that hashing is not performed here.
Only keep the required number of bits of message
Only keep the required number of bits of message |
(in-package :crypto)
(defclass dsa-key ()
((group :initarg :group :reader group)))
(defclass dsa-public-key (dsa-key)
((y :initarg :y :reader dsa-key-y :type integer)))
(defclass dsa-private-key (dsa-key)
((y :initarg :y :reader dsa-key-y :type integer)
(x :initarg :x :reader dsa-key-x :type integer)))
... |
043c5cc3e5f5dfadcf18cf323915826ab30970d68798ee37f00e6f46d4aa1a2b | lem-project/lem | source-path-parser.lisp | ;;;; Source-paths
CMUCL / SBCL use a data structure called " source - path " to locate
;;; subforms. The compiler assigns a source-path to each form in a
compilation unit . Compiler notes usually contain the source - path
;;; of the error location.
;;;
;;; Compiled code objects don't contain source paths, only ... | null | https://raw.githubusercontent.com/lem-project/lem/c1c3d35905bfd0c6d1af1df4f7c6a7f415a1c7e9/lib/micros/swank/source-path-parser.lisp | lisp | Source-paths
subforms. The compiler assigns a source-path to each form in a
of the error location.
Compiled code objects don't contain source paths, only the
"toplevel-form-number" and the (sub-) "form-number". To get from
the form-number to the source-path we need the entire toplevel-form
utilities to do thi... |
CMUCL / SBCL use a data structure called " source - path " to locate
compilation unit . Compiler notes usually contain the source - path
( i.e. we have to read the source code ) . CMUCL has already some
Taken from swank-cmucl.lisp , by
(defpackage micros/source-path-parser
(:use cl)
(:export
rea... |
e597d44e0a361a49495cca4edf509f427f4acad3534f70cc2664ec57e8f21d02 | NoahTheDuke/netrunner-data | combine.clj | (ns nr-data.combine
(:require
[clojure.java.io :as io]
[nr-data.data :as data]
[nr-data.utils :refer [vals->vec]]))
(defn combine-for-jnet
[& _]
(let [cycles (data/cycles)
sets (data/sets)
formats (data/formats)
mwls (data/mwls)
cards (data/combined-cards)]
(print "Wr... | null | https://raw.githubusercontent.com/NoahTheDuke/netrunner-data/aee6759dfa170c126eaab5a6bb00db855acae806/src/nr_data/combine.clj | clojure | (ns nr-data.combine
(:require
[clojure.java.io :as io]
[nr-data.data :as data]
[nr-data.utils :refer [vals->vec]]))
(defn combine-for-jnet
[& _]
(let [cycles (data/cycles)
sets (data/sets)
formats (data/formats)
mwls (data/mwls)
cards (data/combined-cards)]
(print "Wr... | |
0d230b7575ea27bf6c74d26d20a7e76812deae10e52a1a928aaea835f00cce29 | tomjaguarpaw/haskell-opaleye | PrimQuery.hs | # LANGUAGE LambdaCase #
module Opaleye.Internal.PrimQuery where
import Prelude hiding (product)
import qualified Data.List.NonEmpty as NEL
import Data.Semigroup (Semigroup, (<>))
import qualified Opaleye.Internal.HaskellDB.Sql as HSql
import qualified Opaleye.Internal.HaskellDB.PrimQuery as HPQ
i... | null | https://raw.githubusercontent.com/tomjaguarpaw/haskell-opaleye/3046bc6cc544d5fb02c74f07dbb9796e777ac874/src/Opaleye/Internal/PrimQuery.hs | haskell | The function 'Lateral -> PrimQuery -> PrimQuery' represents a
select arrow in the following way:
Lateral
-- ^ Whether to join me laterally
-> PrimQuery
-- ^ The query that I will be joined after. If I refer to columns
-- in here in a way that is only valid when I am joined laterally,
-- then Lateral must b... | # LANGUAGE LambdaCase #
module Opaleye.Internal.PrimQuery where
import Prelude hiding (product)
import qualified Data.List.NonEmpty as NEL
import Data.Semigroup (Semigroup, (<>))
import qualified Opaleye.Internal.HaskellDB.Sql as HSql
import qualified Opaleye.Internal.HaskellDB.PrimQuery as HPQ
i... |
319d22c341141e94c0cbdf4d83ac16c3044ae78ddd3e26f0ce383c8cd9799c0a | Verites/verigraph | Partition.hs | module Data.Partition
( EquivalenceClass
, Partition
, discretePartition
, fromBlocks
, partitionToSurjection
, pickRepresentatives
, allPartitionsOf
, allRefinementsOf
, addToPartition
, mergePairs
, mergeSets
, getElem
, getTail
, tsort
) where
import Data.Foldable (find, fold... | null | https://raw.githubusercontent.com/Verites/verigraph/754ec08bf4a55ea7402d8cd0705e58b1d2c9cd67/src/library/Data/Partition.hs | haskell | | An equivalence class is just a set of elements.
| A partition is a set of disjoint equivalence classes.
| Create the discrete partition of the given set, i.e. the most disjoint partition. In this
partition, each element has its own equivalence class.
| Given a list of disjoint blocks, represented as lists of ele... | module Data.Partition
( EquivalenceClass
, Partition
, discretePartition
, fromBlocks
, partitionToSurjection
, pickRepresentatives
, allPartitionsOf
, allRefinementsOf
, addToPartition
, mergePairs
, mergeSets
, getElem
, getTail
, tsort
) where
import Data.Foldable (find, fold... |
5d94ebf0e8a85fd6aa5a5a2aa71610511f9f4e47d177979feb3224d95f4cc57f | ryanpbrewster/haskell | LetWhereScope.hs | foo x = let y = 2*x in bar y
-- where bar z = y*x (does not compile, y is not in scope)
where bar z = x*z
| null | https://raw.githubusercontent.com/ryanpbrewster/haskell/6edd0afe234008a48b4871032dedfd143ca6e412/hello-world/LetWhereScope.hs | haskell | where bar z = y*x (does not compile, y is not in scope) | foo x = let y = 2*x in bar y
where bar z = x*z
|
7ddaa3669581ec968ab943c84198281318930e096029ab9c9ca5044495f68649 | rudymatela/speculate | Timeout.hs | -- |
-- Module : Test.Speculate.Utils.Timeout
Copyright : ( c ) 2016 - 2019
License : 3 - Clause BSD ( see the file LICENSE )
Maintainer : < >
--
-- This module is part of Speculate.
--
Evaluate values to WHNF until a timeout .
module Test.Speculate.Utils.Timeout
( timeoutToNothing
, f... | null | https://raw.githubusercontent.com/rudymatela/speculate/8ec39747d03033db4349d554467d4b78bb72935d/src/Test/Speculate/Utils/Timeout.hs | haskell | |
Module : Test.Speculate.Utils.Timeout
This module is part of Speculate.
| In microseconds | Copyright : ( c ) 2016 - 2019
License : 3 - Clause BSD ( see the file LICENSE )
Maintainer : < >
Evaluate values to WHNF until a timeout .
module Test.Speculate.Utils.Timeout
( timeoutToNothing
, fromTimeout
, timeoutToFalse
, timeoutToTrue
, timeoutToError
)
where
import System.IO... |
8f49b7ab49d8a5937f07bddafa0886353bc6e4ffc5bfb8385349cff579afc389 | amalloy/aoc-2021 | Main.hs | module Main where
import Control.Arrow ((&&&))
import Data.Array
import Data.Char (digitToInt)
data Octopus = Exhausted | Energized | Latent Int deriving (Eq, Show)
type Cave = Array (Int, Int) Octopus
type Input = Cave
addEnergy :: Int -> Octopus -> Octopus
addEnergy a o = case o of
Latent b | a + b >= 10 -> Ene... | null | https://raw.githubusercontent.com/amalloy/aoc-2021/b46506baa52e3a4c8a122fda8019c1103957371a/day11/src/Main.hs | haskell | module Main where
import Control.Arrow ((&&&))
import Data.Array
import Data.Char (digitToInt)
data Octopus = Exhausted | Energized | Latent Int deriving (Eq, Show)
type Cave = Array (Int, Int) Octopus
type Input = Cave
addEnergy :: Int -> Octopus -> Octopus
addEnergy a o = case o of
Latent b | a + b >= 10 -> Ene... | |
f856b2bcaa440fdc62a60d7e1d27875fc1eaf4407f290b68e3b2aa5f87d12617 | janestreet/base | word_size.ml | open! Import
module Sys = Sys0
type t =
| W32
| W64
[@@deriving_inline sexp_of]
let sexp_of_t =
(function
| W32 -> Sexplib0.Sexp.Atom "W32"
| W64 -> Sexplib0.Sexp.Atom "W64"
: t -> Sexplib0.Sexp.t)
;;
[@@@end]
let num_bits = function
| W32 -> 32
| W64 -> 64
;;
let word_size =
match... | null | https://raw.githubusercontent.com/janestreet/base/c95422a6b5d5dba29c51df3e37b8f50eaff6ad68/src/word_size.ml | ocaml | open! Import
module Sys = Sys0
type t =
| W32
| W64
[@@deriving_inline sexp_of]
let sexp_of_t =
(function
| W32 -> Sexplib0.Sexp.Atom "W32"
| W64 -> Sexplib0.Sexp.Atom "W64"
: t -> Sexplib0.Sexp.t)
;;
[@@@end]
let num_bits = function
| W32 -> 32
| W64 -> 64
;;
let word_size =
match... | |
c72a433ee5bb7e9626e6a1d4b6e0fdf30f27277d46faa8f2d6e5783c013685f9 | RBornat/jape | runproof.mli |
Copyright ( C ) 2003 - 19
This file is part of the proof engine , which is part of .
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 ver... | null | https://raw.githubusercontent.com/RBornat/jape/1f757680878527eebd04919f00bfb18a9b41bdf2/distrib/camlengine/runproof.mli | ocaml |
Copyright ( C ) 2003 - 19
This file is part of the proof engine , which is part of .
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 ver... | |
c37a0cda24ccbb4861510809437406b8c74f94a786437d26a4ba27b56ed4499c | biocad/openapi3 | Validation.hs | {-# OPTIONS_GHC -Wall #-}
# LANGUAGE CPP #
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveFunctor #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
{-# LANGUAGE GADTs #-}
# LANGUAGE Generalized... | null | https://raw.githubusercontent.com/biocad/openapi3/cffc5ebf91212e9658b432cfdb5c3974bb9cf18c/src/Data/OpenApi/Internal/Schema/Validation.hs | haskell | # OPTIONS_GHC -Wall #
# LANGUAGE DataKinds #
# LANGUAGE DeriveFunctor #
# LANGUAGE GADTs #
# LANGUAGE PackageImports #
# LANGUAGE RankNTypes #
# LANGUAGE TemplateHaskell #
# LANGUAGE UndecidableInstances #
... | # LANGUAGE CPP #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE ViewPatterns ... |
3fa3b2e29a1835d4260f71364d43cca368c99473c8fb2e7f51826ec2fddf7657 | jacekschae/learn-reitit-course-files | test_system.clj | (ns cheffy.test-system
(:require [clojure.test :refer :all]
[integrant.repl.state :as state]
[ring.mock.request :as mock]
[muuntaja.core :as m]
[cheffy.auth0 :as auth0]))
(def token (atom nil))
(defn account-fixture
[f]
(auth0/create-auth0-user
{:connection "U... | null | https://raw.githubusercontent.com/jacekschae/learn-reitit-course-files/c13a8eb622a371ad719d3d9023f1b4eff9392e4c/increments/47-tests-refactor/test/cheffy/test_system.clj | clojure | (ns cheffy.test-system
(:require [clojure.test :refer :all]
[integrant.repl.state :as state]
[ring.mock.request :as mock]
[muuntaja.core :as m]
[cheffy.auth0 :as auth0]))
(def token (atom nil))
(defn account-fixture
[f]
(auth0/create-auth0-user
{:connection "U... | |
929c1b38df6607bc1c3016d4fa7ce97eb1f066203722e00e30a19db5a9f2884f | GlideAngle/flare-timing | Alt.hs | module Serve.Alt
( getAltTaskScore
, getAltTaskValidityWorking
, getAltTaskRouteSphere
, getAltTaskRouteEllipse
, getAltTaskLanding
, getAltTaskArrival
) where
import Data.List (zip4)
import Servant (throwError)
import Control.Monad (join)
import Control.Monad.Reader (asks)
import Flight.U... | null | https://raw.githubusercontent.com/GlideAngle/flare-timing/27bd34c1943496987382091441a1c2516c169263/lang-haskell/app-serve/src/Serve/Alt.hs | haskell | module Serve.Alt
( getAltTaskScore
, getAltTaskValidityWorking
, getAltTaskRouteSphere
, getAltTaskRouteEllipse
, getAltTaskLanding
, getAltTaskArrival
) where
import Data.List (zip4)
import Servant (throwError)
import Control.Monad (join)
import Control.Monad.Reader (asks)
import Flight.U... | |
98d24e6183cb508f014bbede8d86d34a1ed31832c07e24f75cb4a2c1cc7ff621 | aeternity/aeternity | aesc_htlc_SUITE.erl | %%%=============================================================================
( C ) 2018 , Aeternity Anstalt
%%% @doc
Test utils for State Channel markets , using HTLC contracts
%%% @end
%%%=============================================================================
-module(aesc_htlc_SUITE).
-export([
... | null | https://raw.githubusercontent.com/aeternity/aeternity/e1c5c0c9d8d599129cc8bc67b50d2caf14bd583b/apps/aechannel/test/aesc_htlc_SUITE.erl | erlang | =============================================================================
@doc
@end
=============================================================================
test case exports
========================================================================
Strategy
We reuse as much as we can from the aesc_fsm_SUI... | ( C ) 2018 , Aeternity Anstalt
Test utils for State Channel markets , using HTLC contracts
-module(aesc_htlc_SUITE).
-export([
all/0
, groups/0
, suite/0
, init_per_suite/1
, end_per_suite/1
, init_per_group/2
, end_per_group/2
, init_per_testca... |
1f42606424e5f5de5c9e764602f9875b7b40017ea1b10453fd4ce2a8430afbf2 | plumatic/grab-bag | bucket.clj | (ns store.bucket
(:refer-clojure :exclude [get get-in put keys seq count sync update merge vals empty? update-in])
(:use [plumbing.core :exclude [update]])
(:require
[clojure.core :as clojure]
[clojure.java.io :as java-io]
[ring.util.codec :as codec]
[plumbing.chm :as chm]
[plumbing.error :as err]
... | null | https://raw.githubusercontent.com/plumatic/grab-bag/a15e943322fbbf6f00790ce5614ba6f90de1a9b5/lib/store/src/store/bucket.clj | clojure | TODO: put on the protocol, implementations can be much more efficient deleting with cursor.
make this a deftype for purposes of extend-type
TODO: observe for hitrate, etc?
Extend Read buckets to clojure maps | (ns store.bucket
(:refer-clojure :exclude [get get-in put keys seq count sync update merge vals empty? update-in])
(:use [plumbing.core :exclude [update]])
(:require
[clojure.core :as clojure]
[clojure.java.io :as java-io]
[ring.util.codec :as codec]
[plumbing.chm :as chm]
[plumbing.error :as err]
... |
89ffe3b168388cbea29809ef1e240c0e75cc5a12340075455b8a1c2fe94bc9c1 | erdos/stencil | util.clj | (ns stencil.util
(:require [clojure.zip])
(:import [io.github.erdos.stencil.exceptions ParsingException EvalException]))
(set! *warn-on-reflection* true)
(defn stacks-difference-key
"Removes suffixes of two lists where key-fn gives the same result."
[key-fn stack1 stack2]
(assert (ifn? key-fn))
(let [cnt ... | null | https://raw.githubusercontent.com/erdos/stencil/92a7dab98affd26ac7c32ab7c4ba5477f5ad1633/src/stencil/util.clj | clojure | return xml zipper of location that matches predicate or nil
non-breaking spaces
like clojure.string/trim but supports a wider range of whitespace characters | (ns stencil.util
(:require [clojure.zip])
(:import [io.github.erdos.stencil.exceptions ParsingException EvalException]))
(set! *warn-on-reflection* true)
(defn stacks-difference-key
"Removes suffixes of two lists where key-fn gives the same result."
[key-fn stack1 stack2]
(assert (ifn? key-fn))
(let [cnt ... |
cc63ec26396ee41296eedf9927d5bcf98e91cc7750a3af55df673131b6cf0809 | oriansj/mes-m2 | getopt-long.scm | Copyright ( C ) 1998 , 2001 , 2006 Free Software Foundation , Inc.
Copyright ( C ) 2017,2018 Jan ( janneke ) Nieuwenhuizen < >
;;;
;; This library 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 ; ... | null | https://raw.githubusercontent.com/oriansj/mes-m2/b44fbc976ae334252de4eb82a57c361a195f2194/module/mes/getopt-long.scm | scheme |
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
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... | Copyright ( C ) 1998 , 2001 , 2006 Free Software Foundation , Inc.
Copyright ( C ) 2017,2018 Jan ( janneke ) Nieuwenhuizen < >
version 2.1 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 51 Franklin Street , Fifth... |
eee39d2daa33d1168e727bca420c2befd1757dc6a18c716a726147e036aee6b1 | facebook/duckling | Tests.hs | Copyright ( c ) 2016 - present , Facebook , Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
module Duckling.Time.ZH.Tests
( tests
) where
import Data.String
import Prelude
import Test.Tasty
impo... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/tests/Duckling/Time/ZH/Tests.hs | haskell | All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. | Copyright ( c ) 2016 - present , Facebook , Inc.
module Duckling.Time.ZH.Tests
( tests
) where
import Data.String
import Prelude
import Test.Tasty
import Duckling.Dimensions.Types
import Duckling.Locale
import Duckling.Testing.Asserts
import Duckling.Testing.Types
import Duckling.Time.ZH.Corpus
import qualifi... |
1dfad2d43ecdd4ea1cdf6f536f2104577d4ca827dd0554a911d753bcc5c7aa3d | open-company/open-company-web | macros.clj | (ns oc.web.macros
(:require [cljs.compiler :as compiler]
[cljs.core :as cljs]))
(defn- to-property [sym]
(symbol (str "-" sym)))
(defmacro goog-extend [type base-type ctor & methods]
`(do
(defn ~type ~@ctor)
(goog/inherits ~type ~base-type)
~@(map
(fn [method]
`(se... | null | https://raw.githubusercontent.com/open-company/open-company-web/dfce3dd9bc115df91003179bceb87cca1f84b6cf/src/main/oc/web/macros.clj | clojure | (ns oc.web.macros
(:require [cljs.compiler :as compiler]
[cljs.core :as cljs]))
(defn- to-property [sym]
(symbol (str "-" sym)))
(defmacro goog-extend [type base-type ctor & methods]
`(do
(defn ~type ~@ctor)
(goog/inherits ~type ~base-type)
~@(map
(fn [method]
`(se... | |
7f96a0a432d32cd45da15c24adc8ee790e35c192ef50f41e984994d0bde0fde1 | bhk/scam | math0.scm | ;;----------------------------------------------------------------
: operations on U and UF values
;;----------------------------------------------------------------
(require "core.scm")
;; Convert decimal digits to unary digits.
;;
(define `(d2u-macro d)
(subst 1 "01" 2 "011" 4 "31" 5 "311"
7 "61" 9 "... | null | https://raw.githubusercontent.com/bhk/scam/59d7c02e673f1faebd0b7625d8c595daaa5efc51/math0.scm | scheme | ----------------------------------------------------------------
----------------------------------------------------------------
Convert decimal digits to unary digits.
Convert unary digits to decimal digits.
Non-nil if X > 0. X may be in decimal *or* (perhaps signed) U format.
already have enough digits t... | : operations on U and UF values
(require "core.scm")
(define `(d2u-macro d)
(subst 1 "01" 2 "011" 4 "31" 5 "311"
7 "61" 9 "81" 8 "611" 6 "3111" 3 "0111" (or d "?")))
(define `(u2d-macro u)
(subst "0111" 3 "3111" 6 "611" 8 "81" 9 "61" 7
"311" 5 "31" 4 "011" 2 "01" 1 u))
(define (d2u d)
... |
dc010e09ed3de38bd43313dc7f4874bce6f7a24cee7dae679aaaef9122f04b15 | expipiplus1/vulkan | VK_NV_shader_subgroup_partitioned.hs | {-# language CPP #-}
-- | = Name
--
-- VK_NV_shader_subgroup_partitioned - device extension
--
-- == VK_NV_shader_subgroup_partitioned
--
-- [__Name String__]
-- @VK_NV_shader_subgroup_partitioned@
--
-- [__Extension Type__]
-- Device extension
--
-- [__Registered Extension Number__]
199
--
-- [__Revision... | null | https://raw.githubusercontent.com/expipiplus1/vulkan/b1e33d1031779b4740c279c68879d05aee371659/src/Vulkan/Extensions/VK_NV_shader_subgroup_partitioned.hs | haskell | # language CPP #
| = Name
VK_NV_shader_subgroup_partitioned - device extension
== VK_NV_shader_subgroup_partitioned
[__Name String__]
@VK_NV_shader_subgroup_partitioned@
[__Extension Type__]
Device extension
[__Registered Extension Number__]
[__Revision__]
[__Extension and Version Dependencies_... | 199
1
- Requires support for Vulkan 1.1
-
2018 - 03 - 17
- , NVIDIA
GLSL extension and
' Vulkan . Core11.Enums . SubgroupFeatureFlagBits . SUBGROUP_FEATURE_PARTITIONED_BIT_NV '
This extension requires Vulkan 1.1 , for general subgroup support .
- ' NV_SHADER_S... |
22e0bf9acce7bc29ec7f80a88e38fd45a89f067d1bef6941cd003d6c8fd0d4b8 | tfausak/salve | Main.hs | import qualified Control.Monad as Monad
import qualified Salve
import qualified System.Exit as Exit
import qualified Test.HUnit as Test
main :: IO ()
main = do
counts <-
Test.runTestTT $
Test.TestList
[ (compare <$> Salve.parseVersion "1.2.3" <*> Salve.parseVersion "2.0.0")
Test.~?= Jus... | null | https://raw.githubusercontent.com/tfausak/salve/806d35f181802bcf8a07f2b390710a9eefd57fca/source/test-suite/Main.hs | haskell | import qualified Control.Monad as Monad
import qualified Salve
import qualified System.Exit as Exit
import qualified Test.HUnit as Test
main :: IO ()
main = do
counts <-
Test.runTestTT $
Test.TestList
[ (compare <$> Salve.parseVersion "1.2.3" <*> Salve.parseVersion "2.0.0")
Test.~?= Jus... | |
0d6cb0be9c74c99531667c4ce338e691a58f12daaabdf782e185034c2d12bd99 | plaidfinch/ComonadSheet | Indexed.hs | |
Module : Control . Comonad . Sheet . Indexed
Description : Adds absolute position to n - dimensional comonadic spreadsheets .
Copyright : Copyright ( c ) 2014
Maintainer :
Stability : experimental
Portability : non - portable
This module defines the @Indexed@ type , whic... | null | https://raw.githubusercontent.com/plaidfinch/ComonadSheet/1cc9a91dc311bc1c692df4faaea091238b7871c2/src/Control/Comonad/Sheet/Indexed.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
| An n-dimensional coordinate is a list of length n of absolute references.
| An indexed sheet is an n-dimensionally nested 'Tape' paired with an n-dimensional coordinate which
represents the absolute position ... | |
Module : Control . Comonad . Sheet . Indexed
Description : Adds absolute position to n - dimensional comonadic spreadsheets .
Copyright : Copyright ( c ) 2014
Maintainer :
Stability : experimental
Portability : non - portable
This module defines the @Indexed@ type , whic... |
34c1d53f242f24a203fb5f36111c70d51222feec5d95d021f64bb0bd0446cbe3 | benzap/eden | reserved.cljc | (ns eden.std.reserved)
(def ^:dynamic *reserved-words*
'[
= ..= .=
and or
== !=
> >= < <=
+ -
* /
not -
end
if then else elseif
for in
while do
until repeat
function ->
])
(defn reserved? [sym]
(contains? (set *reserved-words*) sym))
| null | https://raw.githubusercontent.com/benzap/eden/dbfa63dc18dbc5ef18a9b2b16dbb7af0e633f6d0/src/eden/std/reserved.cljc | clojure | (ns eden.std.reserved)
(def ^:dynamic *reserved-words*
'[
= ..= .=
and or
== !=
> >= < <=
+ -
* /
not -
end
if then else elseif
for in
while do
until repeat
function ->
])
(defn reserved? [sym]
(contains? (set *reserved-words*) sym))
| |
d72aa5f4e682bd07bfa3d2583596985ffd5902fdab1f2d5353724677a8e11462 | Eventuria/demonstration-gsd | RenameWorkspace.hs | # LANGUAGE NamedFieldPuns #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE DataKinds #
module Eventuria.GSD.Write.CommandConsumer.Handling.Commands.RenameWorkspace where
import qualified Data.UUID.V4 as Uuid
import qualified Data.Time as Time
import Eventuria.Libraries.CQRS.Write.CommandConsumption.CommandH... | null | https://raw.githubusercontent.com/Eventuria/demonstration-gsd/5c7692b310086bc172d3fd4e1eaf09ae51ea468f/src/Eventuria/GSD/Write/CommandConsumer/Handling/Commands/RenameWorkspace.hs | haskell | # LANGUAGE NamedFieldPuns #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE DataKinds #
module Eventuria.GSD.Write.CommandConsumer.Handling.Commands.RenameWorkspace where
import qualified Data.UUID.V4 as Uuid
import qualified Data.Time as Time
import Eventuria.Libraries.CQRS.Write.CommandConsumption.CommandH... | |
fc146b122af95c3b4729a3c0bbc1c692c5998fe61b8c7ea26145dff58ae34799 | hbr/fmlib | indent.mli | (** The allowed indentations: Helper module for indentation sensitive parsing.
*)
type expectation =
| Indent of int
(** [Indent n] An indentation of at least [n] columns is expected. *)
| Align of int (** [Align n] Start at colmun [n] is expected. *)
| Align_between of int * int (** [Align_between... | null | https://raw.githubusercontent.com/hbr/fmlib/45ee4d2c76a19ef44557c554de30ec57d94bb9e5/src/parse/indent.mli | ocaml | * The allowed indentations: Helper module for indentation sensitive parsing.
* [Indent n] An indentation of at least [n] columns is expected.
* [Align n] Start at colmun [n] is expected.
* [Align_between a b] Start between the
columns [a] and [b] is expected.
* The expected ind... |
type expectation =
| Indent of int
type violation = expectation
val group:
('a * expectation option) list
-> (expectation option * 'a list) list
* [ group lst ] Group the list of expectations .
Failed expectations with the same indentation expectation ( or not
indentation expectation ) ... |
7ebdb0cb59df223345bbd08541a7f6f226ad05f1e25110ace6702b5aa24521f6 | d-cent/objective8 | create_profile.clj | (ns objective8.front-end.templates.create-profile
(:require [net.cgrand.enlive-html :as html]
[net.cgrand.jsoup :as jsoup]
[objective8.front-end.templates.page-furniture :as pf]
[objective8.front-end.templates.template-functions :as tf]))
(def create-profile-template (html/html-re... | null | https://raw.githubusercontent.com/d-cent/objective8/db8344ba4425ca0b38a31c99a3b282d7c8ddaef0/src/objective8/front_end/templates/create_profile.clj | clojure | (ns objective8.front-end.templates.create-profile
(:require [net.cgrand.enlive-html :as html]
[net.cgrand.jsoup :as jsoup]
[objective8.front-end.templates.page-furniture :as pf]
[objective8.front-end.templates.template-functions :as tf]))
(def create-profile-template (html/html-re... | |
97090687bb02e31cfa87782a3ba4c32bebd9225e2701db99eaf17f40ca8e2695 | hoelzl/Clicc | tidef.lisp | ;;;-----------------------------------------------------------------------------
Copyright ( C ) 1993 Christian - Albrechts - Universitaet zu Kiel , Germany
;;;-----------------------------------------------------------------------------
Projekt : APPLY - A Practicable And Portable Lisp Implementation
;;; ... | null | https://raw.githubusercontent.com/hoelzl/Clicc/cea01db35301144967dc74fd2f96dd58aa52d6ea/src/compiler/tidef.lisp | lisp | -----------------------------------------------------------------------------
-----------------------------------------------------------------------------
------------------------------------------------------
Revision 1.40 1993/12/09 10:31:24 hk
provide wieder an das Dateiende
Revision 1.38 1993... | Copyright ( C ) 1993 Christian - Albrechts - Universitaet zu Kiel , Germany
Projekt : APPLY - A Practicable And Portable Lisp Implementation
Funktion : . Variablen und Konstanten der Typinferenz
$ Revision : 1.40 $
$ Log : , v $
Revision 1.39 1993/11/21 22:07:54 kl
Die Typinferenzfeatures werd... |
d648ff264caebdf5c1689defb7393879baf157c69586eb14ff193673a0d40db7 | cgrand/boring | boring.clj | (ns net.cgrand.boring
(:require [clojure.java.io :as io]))
;; syntax: "(" tunnel ")" rest
;; examples: (ssh:user@server)localhost:5555
;; examples: (ssh:user@server)(oc:pod-name)5555
(defprotocol Connector
(connect-through [connector host port]
"Returns a pair of streams as {:in output-stream :out input-strea... | null | https://raw.githubusercontent.com/cgrand/boring/bca8885f01f8c7c0ad67c8d23cdd4ccc199dec1c/src/net/cgrand/boring.clj | clojure | syntax: "(" tunnel ")" rest
examples: (ssh:user@server)localhost:5555
examples: (ssh:user@server)(oc:pod-name)5555
TODO api for repeatedly establishing connections while sharing tunnels | (ns net.cgrand.boring
(:require [clojure.java.io :as io]))
(defprotocol Connector
(connect-through [connector host port]
"Returns a pair of streams as {:in output-stream :out input-stream} -- yes they are inverted."))
(def socket-connector
(reify
java.io.Closeable
(close [_] nil)
Connector
... |
81bb3ddd8ec72ab09ab6c318f43c4e54299d671670437d55e29621a41d4b1d16 | emqx/quic | quicer_nif.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/emqx/quic/d2d8db11e6e5a54ff325c6db9a9816eee8ffb020/src/quicer_nif.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(quicer_nif).
-export([ open_lib/0
, close_lib/0
, reg_open/0
, re... |
6559fc6a50c52ad22f2b3f16a2578882b23439c8c78517869dab987ef8a4bbcb | gvolpe/effects-playground | Main.hs | module Main where
import Prelude hiding ( read )
import Cap ( echoCap )
import Cloud ( cloudEcho )
import Fusion ( fusedEchoIO )
import Poly ( echoPol... | null | https://raw.githubusercontent.com/gvolpe/effects-playground/2b5600fe0378b6716282b59785c98a8a75445aa1/app/Main.hs | haskell | module Main where
import Prelude hiding ( read )
import Cap ( echoCap )
import Cloud ( cloudEcho )
import Fusion ( fusedEchoIO )
import Poly ( echoPol... | |
80c04b8cce4bbcdde881d15894dbf44e1330064b731d83941ed68fa6974896b9 | justinethier/cyclone | sets-test.scm | (import
(scheme base)
(scheme char)
(scheme complex)
(cyclone test)
(srfi 113)
(srfi 128)
)
(include "comparators-shim.scm")
;(use test)
( use srfi-113 )
( use srfi-128 )
;(load "../sets/comparators-shim.scm")
(test-group "sets"
(define (big x) (> x 5))
(test-group "sets"
(test-group "sets/simple"
(de... | null | https://raw.githubusercontent.com/justinethier/cyclone/a1c2a8f282f37ce180a5921ae26a5deb04768269/srfi/sets/sets-test.scm | scheme | (use test)
(load "../sets/comparators-shim.scm")
nums is now {}
syms is now {a, b, c, d}
nums2 is now {}
esyms is now {}
syms is now {a, b, c, d, e, f}
syms is now {a, b, c, d}
end sets/simple
(define-values (set1 obj1)
(set-search! (set-copy yam) #\! failure/insert error))
(test-assert (set=? yam! set1)... | (import
(scheme base)
(scheme char)
(scheme complex)
(cyclone test)
(srfi 113)
(srfi 128)
)
(include "comparators-shim.scm")
( use srfi-113 )
( use srfi-128 )
(test-group "sets"
(define (big x) (> x 5))
(test-group "sets"
(test-group "sets/simple"
(define nums (set number-comparator))
(define syms (... |
2cfba4c4ad35125128973768badfc209aa5577d94b71b8c25ea7be958c216a8e | souenzzo/souenzzo.github.io | fnvr.clj | (ns br.com.souenzzo.fnvr
(:require [clojure.data.json :as json]
[clojure.string :as string]
[clojure.java.io :as io])
(:import (java.util Date)
(java.time Instant)
(java.net URLEncoder URI)
(java.nio.charset StandardCharsets)
(java.net.http HttpCli... | null | https://raw.githubusercontent.com/souenzzo/souenzzo.github.io/30a811c4e5633ad07bba1d58d19eb091dac222e9/projects/fnvr/src/br/com/souenzzo/fnvr.clj | clojure | (doto prn) | (ns br.com.souenzzo.fnvr
(:require [clojure.data.json :as json]
[clojure.string :as string]
[clojure.java.io :as io])
(:import (java.util Date)
(java.time Instant)
(java.net URLEncoder URI)
(java.nio.charset StandardCharsets)
(java.net.http HttpCli... |
b490f68b147364141ed6f15516d6b244e5486772fc59832dbad7fae2b9a72303 | xapi-project/xen-api | test_pvs_site.ml |
* Copyright ( C ) Citrix Systems Inc.
*
* 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 ; version 2.1 only . with the special
* exception on linking described in file LI... | null | https://raw.githubusercontent.com/xapi-project/xen-api/47fae74032aa6ade0fc12e867c530eaf2a96bf75/ocaml/tests/test_pvs_site.ml | ocaml |
* Copyright ( C ) Citrix Systems Inc.
*
* 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 ; version 2.1 only . with the special
* exception on linking described in file LI... | |
2f34a417b7df08b6be2dd38af4bbda1ab3fa97c17f60410288961d2501cb213a | alt-romes/ghengin | Utils.hs | module Ghengin.Vulkan.Utils where
import qualified FIR
import qualified Vulkan as Vk
stageFlag :: FIR.Shader -> Vk.ShaderStageFlagBits
stageFlag FIR.VertexShader = Vk.SHADER_STAGE_VERTEX_BIT
stageFlag FIR.TessellationControlShader = Vk.SHADER_STAGE_TESSELLATION_CONTROL_BIT
stageFlag FIR.Tessellatio... | null | https://raw.githubusercontent.com/alt-romes/ghengin/7d58fe3af2859f0a888158dba98e277b64c3d349/src/Ghengin/Vulkan/Utils.hs | haskell | module Ghengin.Vulkan.Utils where
import qualified FIR
import qualified Vulkan as Vk
stageFlag :: FIR.Shader -> Vk.ShaderStageFlagBits
stageFlag FIR.VertexShader = Vk.SHADER_STAGE_VERTEX_BIT
stageFlag FIR.TessellationControlShader = Vk.SHADER_STAGE_TESSELLATION_CONTROL_BIT
stageFlag FIR.Tessellatio... | |
4c08cd7c893fa3c9fbe30b14b341286b100a0e15d256c51a363594d3c2a67561 | CSVdB/pinky | LinearAlgebra.hs | module Pinky.Core.LinearAlgebra
( V
, konstV
, M
, diag
, (<#>)
, (<#.>)
, (<+>)
, (<->)
, Prod
, Min
, Plus
, ElemProd
, outerProd
, transpose
, vToM
, mToV
, mapV
, mapMatrix
, maxIndex
, intToV
, listToV
, listToM
, unsafeLis... | null | https://raw.githubusercontent.com/CSVdB/pinky/e77a4c0812ceb4b8548c41a7652fb247c2ab39e0/pinky/src/Pinky/Core/LinearAlgebra.hs | haskell | module Pinky.Core.LinearAlgebra
( V
, konstV
, M
, diag
, (<#>)
, (<#.>)
, (<+>)
, (<->)
, Prod
, Min
, Plus
, ElemProd
, outerProd
, transpose
, vToM
, mToV
, mapV
, mapMatrix
, maxIndex
, intToV
, listToV
, listToM
, unsafeLis... | |
34c9f5fee818e55520eea0d9ea844d78516fb80c4a7051ebed17da383c6abb66 | mfoemmel/erlang-otp | user.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2009 . 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 Pub... | null | https://raw.githubusercontent.com/mfoemmel/erlang-otp/9c6fdd21e4e6573ca6f567053ff3ac454d742bc2/lib/kernel/src/user.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 limita... | Copyright Ericsson AB 1996 - 2009 . 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 "
-module(user).
-compile( [ inline, { inline... |
bc4579659f8f3a270bdfee9f6ad2bcf19f74efa69c399e0c4d6a4a853698ebc0 | plumatic/grab-bag | fetched_page.clj | (ns domain.docs.fetched-page
(:use plumbing.core)
(:require
[schema.core :as s]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Schemas and Constructors
(s/defschema FetchedPage
{:url (s/named String "canonical first casing of url that is observed")
:res... | null | https://raw.githubusercontent.com/plumatic/grab-bag/a15e943322fbbf6f00790ce5614ba6f90de1a9b5/lib/domain/src/domain/docs/fetched_page.clj | clojure | (ns domain.docs.fetched-page
(:use plumbing.core)
(:require
[schema.core :as s]))
Schemas and Constructors
(s/defschema FetchedPage
{:url (s/named String "canonical first casing of url that is observed")
:resolved (s/named String "resolved version of url that comes from response")
:fetch-date Long
... | |
a8df41ccc0291e270b329d18e6251f434177ee0325f2d3f2bd5649170ddf681c | finnishtransportagency/harja | talvihoidon_hoitoluokat.clj | (ns harja.palvelin.integraatiot.paikkatietojarjestelma.tuonnit.talvihoidon-hoitoluokat
(:require [taoensso.timbre :as log]
[clojure.java.jdbc :as jdbc]
[harja.kyselyt.hoitoluokat :as hoitoluokat]
[harja.domain.hoitoluokat :as domain]
[harja.palvelin.integraatiot.paikkat... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/2f6ad1bbabd403bd8c7e553e2b0950e52c3968a6/src/clj/harja/palvelin/integraatiot/paikkatietojarjestelma/tuonnit/talvihoidon_hoitoluokat.clj | clojure | tienumero
aosa
aet
losa
let | (ns harja.palvelin.integraatiot.paikkatietojarjestelma.tuonnit.talvihoidon-hoitoluokat
(:require [taoensso.timbre :as log]
[clojure.java.jdbc :as jdbc]
[harja.kyselyt.hoitoluokat :as hoitoluokat]
[harja.domain.hoitoluokat :as domain]
[harja.palvelin.integraatiot.paikkat... |
46ae060597f03eb925c893ad9af23ebfbecc7e550e1057895c5bc8a0dc101845 | NetComposer/nksip | fork_test_server2.erl | %% -------------------------------------------------------------------
%%
fork_test :
%%
Copyright ( c ) 2013 . All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may ob... | null | https://raw.githubusercontent.com/NetComposer/nksip/7fbcc66806635dc8ecc5d11c30322e4d1df36f0a/test/callbacks/fork_test_server2.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissi... | fork_test :
Copyright ( c ) 2013 . All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(fo... |
fa676ca5f1c8037f0a3690c51de30806ca96d82c9763c9a46c3db6883671c2ef | tommaisey/aeon | mk.scm | (mk-r6rs '(rsc3)
(cons "../src/sys.guile.scm" rsc3-src)
(string-append (list-ref (command-line) 1) "/rsc3.guile.sls")
rsc3-dep
'()
'())
(mk-r6rs '(rsc3)
(cons "../src/sys.plt.scm" rsc3-src)
(string-append (list-ref (command-line) 1) "/rsc3.mzscheme.sls")
(cons '(prefix (scheme) plt:) rsc3-dep)
'()
... | null | https://raw.githubusercontent.com/tommaisey/aeon/80744a7235425c47a061ec8324d923c53ebedf15/libs/third-party/sc3/rsc3/src/ext/mk.scm | scheme | (mk-r6rs '(rsc3)
(cons "../src/sys.guile.scm" rsc3-src)
(string-append (list-ref (command-line) 1) "/rsc3.guile.sls")
rsc3-dep
'()
'())
(mk-r6rs '(rsc3)
(cons "../src/sys.plt.scm" rsc3-src)
(string-append (list-ref (command-line) 1) "/rsc3.mzscheme.sls")
(cons '(prefix (scheme) plt:) rsc3-dep)
'()
... | |
0db89f9675a7968d998c593ae2e84225850562fb181e0abea94d032fb1738412 | heyarne/airsonic-ui | events.cljs | (ns bulma.modal.events
(:require [re-frame.core :as rf]))
(defn show-modal [db [_ modal-id]]
(assoc-in db [:bulma :visible-modal] modal-id))
(rf/reg-event-db ::show show-modal)
(defn hide-modal [db _]
(update db :bulma dissoc :visible-modal))
(rf/reg-event-db ::hide hide-modal)
(defn toggle-modal [db [_ moda... | null | https://raw.githubusercontent.com/heyarne/airsonic-ui/7adb03d6e2ba0ff764796a57b7e87f62b242c9b7/src/cljs/bulma/modal/events.cljs | clojure | (ns bulma.modal.events
(:require [re-frame.core :as rf]))
(defn show-modal [db [_ modal-id]]
(assoc-in db [:bulma :visible-modal] modal-id))
(rf/reg-event-db ::show show-modal)
(defn hide-modal [db _]
(update db :bulma dissoc :visible-modal))
(rf/reg-event-db ::hide hide-modal)
(defn toggle-modal [db [_ moda... | |
028927cd81d352d8d0e7f50c062fa439f4d83a4d8300a68fe73137381bf41787 | bgamari/the-thoralf-plugin | Nat.hs | {-# LANGUAGE TypeInType #-}
{-# LANGUAGE GADTs #-}
# LANGUAGE TypeOperators #
# LANGUAGE StandaloneDeriving #
# LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE RankNTypes #-}
{-# OPTIONS_GHC -fplugin ThoralfPlugin.Plugin #-}
module Nat where
import ThoralfPlugin.Theory.Bool
import Data.Type.Equality
import Data.Kind
imp... | null | https://raw.githubusercontent.com/bgamari/the-thoralf-plugin/fa4e403b25bfcaf9e8d5142ab40d3c54b33a3630/test-suite-rows/Nat.hs | haskell | # LANGUAGE TypeInType #
# LANGUAGE GADTs #
# LANGUAGE RankNTypes #
# OPTIONS_GHC -fplugin ThoralfPlugin.Plugin # | # LANGUAGE TypeOperators #
# LANGUAGE StandaloneDeriving #
# LANGUAGE AllowAmbiguousTypes #
module Nat where
import ThoralfPlugin.Theory.Bool
import Data.Type.Equality
import Data.Kind
import GHC.TypeLits
test1 :: 1 :~: 1
test1 = Refl
test2 :: (a + 1) :~: (1 + a)
test2 = Refl
test3 :: (a + b) :~: (b + a)
test3 = ... |
07c554c946ba0053462f1fa36a30388c9dd8bdf75840d15e7987187229fdcb81 | ewestern/geos | Profile.hs | import Data.Geometry.Geos.Geometry
import Data.Geometry.Geos.Types
import qualified Data.Vector as V
import qualified Data.Set as S
import qualified Data.ByteString.Char8 as BS8
import Data.Geometry.Geos.Serialize
loadThingsFromFile :: FilePath -> IO [Some Geometry]
loadThingsFromFile fp = do
rows <- BS8.readFile f... | null | https://raw.githubusercontent.com/ewestern/geos/3568c3449efe180bd89959c9247d4667137662b6/profile/Profile.hs | haskell | import Data.Geometry.Geos.Geometry
import Data.Geometry.Geos.Types
import qualified Data.Vector as V
import qualified Data.Set as S
import qualified Data.ByteString.Char8 as BS8
import Data.Geometry.Geos.Serialize
loadThingsFromFile :: FilePath -> IO [Some Geometry]
loadThingsFromFile fp = do
rows <- BS8.readFile f... | |
b50342180363105eddadc0010809783d6badf903391af2e593260c22f6a88813 | bristolpl/intensional-datatys | FromCore.hs | # LANGUAGE LambdaCase #
module Intensional.FromCore
( freshCoreType,
freshCoreScheme,
fromCoreCons,
consInstArgs,
getVar,
)
where
import Control.Monad.RWS
import qualified Data.IntSet as I
import qualified Data.Map as M
import GhcPlugins hiding ((<>), Expr (..), Type)
import Intensional.InferM
imp... | null | https://raw.githubusercontent.com/bristolpl/intensional-datatys/ce6e7f5069530ea21a3e19c8e9e17fc23dc8e66c/src/Intensional/FromCore.hs | haskell | A fresh monomorphic type
A fresh polymorphic type
The type of a constructor injected into a fresh refinement environment
The argument types of an instantiated constructor
Instantiate type synonym arguments
Disregard type class evidence
Convert a monomorphic core type
Instantiate type synonyms
Disregard type cl... | # LANGUAGE LambdaCase #
module Intensional.FromCore
( freshCoreType,
freshCoreScheme,
fromCoreCons,
consInstArgs,
getVar,
)
where
import Control.Monad.RWS
import qualified Data.IntSet as I
import qualified Data.Map as M
import GhcPlugins hiding ((<>), Expr (..), Type)
import Intensional.InferM
imp... |
46c7265feb3e07f6a08aa9eca7c7e803342c4a1c66886a5b00ffa1c1bb98c682 | TrustInSoft/tis-interpreter | sparecode_params.ml | Modified by TrustInSoft
(**************************************************************************)
(* *)
This file is part of Frama - C.
(* ... | null | https://raw.githubusercontent.com/TrustInSoft/tis-interpreter/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/src/plugins/sparecode/sparecode_params.ml | ocaml | ************************************************************************
alternatives)
... | Modified by TrustInSoft
This file is part of Frama - C.
Copyright ( C ) 2007 - 2015
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Softwa... |
1740e44b4e2cfadc4990fe3609b16dc2fba7be7413aa662f4e94218573eb12ce | kritzcreek/fby19 | AST.hs | {-# language OverloadedStrings #-}
module AST where
import Prelude hiding (unwords)
import Data.Text (Text, unwords)
import qualified Data.Text as Text
data Exp
= EVar Text
| ELit Lit
| EApp Exp Exp
| ELam Text Exp
| ELet Text Exp Exp
deriving (Eq, Ord, Show)
data Lit
= LInt Integer
| LBool Bool
d... | null | https://raw.githubusercontent.com/kritzcreek/fby19/c6b6f541686055923fb694692c0568345416b9d1/src/AST.hs | haskell | # language OverloadedStrings #
Ignore from here onwards
variables (Should be enough for the talk :D) | module AST where
import Prelude hiding (unwords)
import Data.Text (Text, unwords)
import qualified Data.Text as Text
data Exp
= EVar Text
| ELit Lit
| EApp Exp Exp
| ELam Text Exp
| ELet Text Exp Exp
deriving (Eq, Ord, Show)
data Lit
= LInt Integer
| LBool Bool
deriving (Eq, Ord, Show)
data Type
... |
7b2e4c7dc385f5be55ac86c2e1e6ade85fc7b8ea086f64667ab336e5bbb9b0b6 | Smoltbob/Caml-Est-Belle | basmlparser.ml | let print_ast l =
let s = (Bparser.toplevel Blexer.token l) in
print_string (Bsyntax.to_string_top s); print_newline ()
let file f =
let inchan = open_in f in
try
print_ast (Lexing.from_channel inchan);
close_in inchan
with e -> (close_in inchan; raise e)
let () =
let files = ref [] in... | null | https://raw.githubusercontent.com/Smoltbob/Caml-Est-Belle/3d6f53d4e8e01bbae57a0a402b7c0f02f4ed767c/compiler/basmlparser.ml | ocaml | let print_ast l =
let s = (Bparser.toplevel Blexer.token l) in
print_string (Bsyntax.to_string_top s); print_newline ()
let file f =
let inchan = open_in f in
try
print_ast (Lexing.from_channel inchan);
close_in inchan
with e -> (close_in inchan; raise e)
let () =
let files = ref [] in... | |
59b1102b52d57de0cfc1d129a2a4dfa691202977b3b67a5a21173fd4d484c599 | tomjridge/tjr_simple_earley | test2.ml | test2 , represent nt_item as int
(* compared to test, we use lazy enumeration *)
open Tjr_simple_earley
open Util.Map_ops
open Fast_ds
(* simple test ------------------------------------------------------ *)
Encode nonterminals and terminals as ints ; nts are even ; tms are
odd
odd *)
type sym = E | One... | null | https://raw.githubusercontent.com/tomjridge/tjr_simple_earley/ca558e0e7f4ddba4cd6573bf180710cd02f25ba4/_archive/2019-04-16/bin/test2.ml | ocaml | compared to test, we use lazy enumeration
simple test ------------------------------------------------------
Provide a function that produces new items, given a nonterminal and
an input position k
Example input; use command line argument
Provide a function that details how to parse terminals at a given
p... | test2 , represent nt_item as int
open Tjr_simple_earley
open Util.Map_ops
open Fast_ds
Encode nonterminals and terminals as ints ; nts are even ; tms are
odd
odd *)
type sym = E | One | Eps
let is_nt = function | E -> true | _ -> false
module X1 = struct type nonrec sym = sym let is_nt = is_nt end
mo... |
592a2dbc656f5eddfac4bf83cbdbf15baf7d4be65e32e978a4bf609e0e1a3ad2 | ertugrulcetin/ClojureNews | user.cljs | (ns route.user
(:require-macros [secretary.core :refer [defroute]])
(:require [reagent.core :as r]
[secretary.core]
[view.user]
[view.changepassword]
[util.view]
[controller.user :as controller]))
(defroute user "/user/:username" [username]
(con... | null | https://raw.githubusercontent.com/ertugrulcetin/ClojureNews/28002f6b620fa4977d561b0cfca0c7f6a635057b/src/cljs/route/user.cljs | clojure | (ns route.user
(:require-macros [secretary.core :refer [defroute]])
(:require [reagent.core :as r]
[secretary.core]
[view.user]
[view.changepassword]
[util.view]
[controller.user :as controller]))
(defroute user "/user/:username" [username]
(con... | |
e9a3cdb7b693f3b84b64951edcf7f2cb0265c8cfb2414885feeb1cc50e6537b3 | davejacobs/ml | logistic.clj | (ns ml.logistic
(:require [ml.optimization :as optimization])
(:use clojure.options
[incanter core io stats]))
(defn g [z]
(/ 1 (+ 1 (exp (- z)))))
(defn h [xs thetas]
(matrix-map g (mmult xs thetas)))
(defn logarithmic-cost [hypothesis actual]
(let [m (count hypothesis)
multiplier (/ 1 m)
... | null | https://raw.githubusercontent.com/davejacobs/ml/4ceda8cee8a79ff52e57484c2988a2ddf10def7f/src/ml/logistic.clj | clojure | (ns ml.logistic
(:require [ml.optimization :as optimization])
(:use clojure.options
[incanter core io stats]))
(defn g [z]
(/ 1 (+ 1 (exp (- z)))))
(defn h [xs thetas]
(matrix-map g (mmult xs thetas)))
(defn logarithmic-cost [hypothesis actual]
(let [m (count hypothesis)
multiplier (/ 1 m)
... | |
78c70502b8f83b4d03166eb92a7ac8b049123ef36ef4ea930a4cb9ea0633c3dc | wdebeaum/step | wood.lisp | ;;;;
;;;; W::WOOD
;;;;
(define-words :pos W::n :templ count-pred-templ
:tags (:base500)
:words (
(W::WOOD
(SENSES
((meta-data :origin BOLT :entry-date 20031230 :change-date nil :comments most-frequent-words)
(LF-PARENT ONT::material)
(TEMPL MASS-PRED-TEMPL)
)
)
)
))
| null | https://raw.githubusercontent.com/wdebeaum/step/f38c07d9cd3a58d0e0183159d4445de9a0eafe26/src/LexiconManager/Data/new/wood.lisp | lisp |
W::WOOD
|
(define-words :pos W::n :templ count-pred-templ
:tags (:base500)
:words (
(W::WOOD
(SENSES
((meta-data :origin BOLT :entry-date 20031230 :change-date nil :comments most-frequent-words)
(LF-PARENT ONT::material)
(TEMPL MASS-PRED-TEMPL)
)
)
)
))
|
4b372c6b5814f69f9094a7a592500e797af1f19a3b81d7d0f8dcf3c96ec113d2 | elaforge/karya | LIntegrate.hs | Copyright 2013
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or -3.0.txt
-- | Functions to deal with derive and score integration.
module Cmd.Repl.LIntegrate where
import qualified Data.List as List
import qualified Data.Map as Map
import qualified Data.Set as... | null | https://raw.githubusercontent.com/elaforge/karya/b4a5700868f4409c8d4f246bf93a31fc81662341/Cmd/Repl/LIntegrate.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt
| Functions to deal with derive and score integration.
* create
| Create an integrated block from the focused block. The block integrate
integrate call, but there isn't much point since it won't reintegrate... | Copyright 2013
module Cmd.Repl.LIntegrate where
import qualified Data.List as List
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified Data.Text as Text
import qualified Cmd.Cmd as Cmd
import qualified Cmd.Create as Create
import qualified Cmd.Edit as Edit
import qualified Cmd.Integ... |
92362eee44bb14323cd737abbe1c019fb07a52fa5a93f6a2e01121e908f28a2c | Zulu-Inuoe/clution | enum.lisp | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
;;; enum.lisp --- Defining foreign constants as Lisp keywords.
;;;
Copyright ( C ) 2005 - 2006 , < >
;;;
;;; Permission is hereby granted, free of charge, to any person
;;; obtaining a copy of this software and associated documentation
files ( the " Software "... | null | https://raw.githubusercontent.com/Zulu-Inuoe/clution/b72f7afe5f770ff68a066184a389c23551863f7f/cl-clution/qlfile-libs/cffi_0.19.0/src/enum.lisp | lisp | -*- Mode: lisp; indent-tabs-mode: nil -*-
enum.lisp --- Defining foreign constants as Lisp keywords.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use, copy,
modify, merge, publi... | Copyright ( C ) 2005 - 2006 , < >
files ( the " Software " ) , to deal in the Software without
of the Software , and to permit persons to whom the Software is
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ,
(in-package ... |
d893150de55b9dadadd6c93e60ef37375fb21d5b7405a6e299f263f752c2aa93 | fishcakez/sbroker | sbroker_fq2_queue.erl | %%-------------------------------------------------------------------
%%
Copyright ( c ) 2016 , < >
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a copy of the License at
%%
%% -2.0
... | null | https://raw.githubusercontent.com/fishcakez/sbroker/10f7e3970d0a296fbf08b1d1a94c88979a7deb5e/test/sbroker_fq2_queue.erl | erlang | -------------------------------------------------------------------
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,
KIND, either express or implied. See the Lic... | Copyright ( c ) 2016 , < >
This file is provided to you under the Apache License ,
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(sbroker_fq2_queue).
-behaviour(sbroker_queue).
-behaviour(sbroker_fair_queue).
-export([init/3]).
... |
b7c6b002ae526e9ebf361bba79c3f7cb652d3125755ec2662eb822ceaa135e55 | well-typed/optics | Operators.hs | -- |
-- Module: Optics.Operators
-- Description: Definitions of infix operators for optics.
--
-- Defines some infix operators for optics operations. This is a deliberately
-- small collection.
--
If you like operators , you may also wish to import @Optics . State . Operators@
from the @optics - extra@ package .
--... | null | https://raw.githubusercontent.com/well-typed/optics/7cc3f9c334cdf69feaf10f58b11d3dbe2f98812c/optics-core/src/Optics/Operators.hs | haskell | |
Module: Optics.Operators
Description: Definitions of infix operators for optics.
Defines some infix operators for optics operations. This is a deliberately
small collection.
| Flipped infix version of 'view'.
# INLINE (^.) #
| Flipped infix version of 'preview'.
# INLINE (^?) #
| Flipped infix version of '... | If you like operators , you may also wish to import @Optics . State . Operators@
from the @optics - extra@ package .
module Optics.Operators
( (^.)
, (^..)
, (^?)
, (#)
, (%~)
, (%!~)
, (.~)
, (!~)
, (?~)
, (?!~)
)
where
import Optics.AffineFold
import Optics.Fold
import Optics.Getter
impor... |
aa21d491b5da951366fb0e1bc6dcdb4a44d50305c26f48e39dd66b388ec25014 | ghollisjr/cl-ana | h5e.lisp | TBP
H5E_ERR_CLS_g
| null | https://raw.githubusercontent.com/ghollisjr/cl-ana/5cb4c0b0c9c4957452ad2a769d6ff9e8d5df0b10/hdf-cffi/src/h5e.lisp | lisp | TBP
H5E_ERR_CLS_g
| |
b816d7a19f9e853a645604e2acf6477fa84ebb95177a68f4ddededa45db1f8fe | y-taka-23/miso-tutorial-app | Api.hs | # LANGUAGE DataKinds #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
module Api where
import Miso
import Servant
import Action
import Html
import Model
import Routing
type Api = JsonApi :<|> IsomorphicApi :<|> StaticApi :<|>... | null | https://raw.githubusercontent.com/y-taka-23/miso-tutorial-app/6c2152a546f3cb82b498be4995ba29e669509eed/server/Api.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE TypeOperators # | # LANGUAGE DataKinds #
module Api where
import Miso
import Servant
import Action
import Html
import Model
import Routing
type Api = JsonApi :<|> IsomorphicApi :<|> StaticApi :<|> NotFoundApi
type JsonApi =
"api" :> "players" :> Get '[JSON... |
b4b58b0c01f581245d9be8fe84d86e176659a7d243ec8019d51c78df6152c3c9 | outergod/cl-heredoc | ring-buffer.lisp | ;;;; cl-heredoc - ring-buffer.lisp
Copyright ( C ) 2010 < >
;;;; This file is part of cl-heredoc.
;;;; cl-heredoc 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
;;... | null | https://raw.githubusercontent.com/outergod/cl-heredoc/a8c8a3557bb6b4854adff86f10182c22e6676ac8/src/ring-buffer.lisp | lisp | cl-heredoc - ring-buffer.lisp
This file is part of cl-heredoc.
cl-heredoc is free software; you can redistribute it and/or modify
either version 3 of the License , or
(at your option) any later version.
cl-heredoc is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the impl... | Copyright ( C ) 2010 < >
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
(in-package :cl-heredoc)
Operations on ring buffers , as described by in ANSI Common Lisp .
(defstruct ring-buffer
"Structure defining ring b... |
58c9d76005a59ebca36ff440c7c80d3a4f59ef28749e71fe5895809bd54d4598 | oakes/Nightweb | service.clj | (ns net.clandroid.service
(:require [neko.-utils :as utils])
(:import [android.app Activity]))
(defn start-service!
[^Activity context class-name connected]
(let [intent (android.content.Intent.)
connection (proxy [android.content.ServiceConnection] []
(onServiceConnected [componen... | null | https://raw.githubusercontent.com/oakes/Nightweb/089c7a99a9a875fde33cc29d56e1faf54dc9de84/android/src/clojure/net/clandroid/service.clj | clojure | (ns net.clandroid.service
(:require [neko.-utils :as utils])
(:import [android.app Activity]))
(defn start-service!
[^Activity context class-name connected]
(let [intent (android.content.Intent.)
connection (proxy [android.content.ServiceConnection] []
(onServiceConnected [componen... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.