Skip to content

Instantly share code, notes, and snippets.

@matonix
Created May 3, 2020 09:37
Show Gist options
  • Save matonix/9d9814d091658466f67a1af2a36b16e2 to your computer and use it in GitHub Desktop.
Save matonix/9d9814d091658466f67a1af2a36b16e2 to your computer and use it in GitHub Desktop.
VSCode User Snippet for Haskell (AtCoder)
{
// Imports
"Import ByteString Char8": {
"prefix": "imbs",
"body": [
"import qualified Data.ByteString.Char8 as BS",
],
"description": "Import BS"
},
"Import Vector Unboxed": {
"prefix": "imvu",
"body": [
"import qualified Data.Vector.Unboxed as VU",
"import qualified Data.Vector.Unboxed.Mutable as VUM",
],
"description": "Import VU/VUM"
},
"Import for Int Line": {
"prefix": "imil",
"body": [
"import qualified Data.ByteString.Char8 as BS",
"import qualified Data.ByteString.Lazy.Char8 as BSL",
"import qualified Data.ByteString.Builder as BSB",
"import Data.Char ( isSpace )",
"import Data.List ( unfoldr )"
],
"description": "Import for Int Line"
},
// Reads
"Read ByteString Char8": {
"prefix": "rbs",
"body": [
"${s} <- BS.getLine"
],
"description": "Read ByteString"
},
"Read Int Line": {
"prefix": "ril",
"body": [
"${xs} <- unfoldr (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine"
],
"description": "Read Int Line"
},
"Read Int": {
"prefix": "ri",
"body": [
"${x} <- readLn"
],
"description": "Read Int"
},
// Pragmas
"Pragma": {
"prefix": "pragma",
"body": [
"{-# ${x} #-}"
],
"description": "Pragma"
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment