Skip to content

Instantly share code, notes, and snippets.

@ryanucode
Created April 7, 2017 23:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ryanucode/fc40663753e4bdec6c18b6ac5645e73f to your computer and use it in GitHub Desktop.
Save ryanucode/fc40663753e4bdec6c18b6ac5645e73f to your computer and use it in GitHub Desktop.
module Lib.Types exposing (..)
import Json.Encode as Encode
import Set exposing (Set)
type alias Id = String
type alias FileId = String
type alias TokenId = String
type alias ExerciseId = String
type alias ChapterId = String
type alias Callback = String
type alias HasId a = { a | id : String }
type alias File =
{ name : String
, content : String
}
type alias Token =
{ exerciseId : String
, ltiSessionId : String
}
type alias Exercise =
{ name : String
, instructions : String
, givenFileName : String
, givenHead : String
, givenBody : String
, givenTail : String
, library: String
, assertions : String
, solution : String
, suppressedErrors : List (Id, String)
}
type alias Chapter =
{ name : String
, library : String
, exercises : List (ExerciseId, String)
}
type alias AssertionMessage =
{ message : String
, file : String
, origin : String
}
-- as exercise testing response
type alias AssertionResponse =
{ passing : Bool
, messages : List AssertionMessage
}
-- used to represent the testing state of an exercise
type AssertionStatus
= Error String
| Untested
| Passing
| Failing (List AssertionMessage)
type alias Range = (Int, Int)
@ryanucode
Copy link
Author

ryanucode commented Apr 7, 2017

type alias Snapshot a =
  { key : String
  , val : a
  , ref : String
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment