https://github.com/mbg/moss
Haskell client for Moss
https://github.com/mbg/moss
Last synced: about 1 month ago
JSON representation
Haskell client for Moss
- Host: GitHub
- URL: https://github.com/mbg/moss
- Owner: mbg
- License: mit
- Created: 2018-03-01T13:38:32.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-07-12T13:41:38.000Z (11 months ago)
- Last Synced: 2025-04-28T11:25:13.657Z (about 1 month ago)
- Language: Haskell
- Size: 42 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: ChangeLog.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Haskell client library for Moss



[](https://hackage.haskell.org/package/moss)Haskell client library for [Moss](https://theory.stanford.edu/~aiken/moss/) which is an online service for checking for code similarity, primarily aimed at detecting plagiarism.
## Example
In order to use Moss, you need to register on the [Moss website](https://theory.stanford.edu/~aiken/moss/). Once you have your access token, using the library is fairly easy:
```haskell
import Stanford.Mosscfg :: MossCfg
cfg = defaultMossCfg{
mossLanguage = Haskell,
mossUser = "[YOUR ACCESS TOKEN HERE]"
}main :: IO ()
main = do
url <- withMoss cfg $ do
addBaseFile "Skeleton" "Skeleton.hs"
addFile "StudentA" "StudentA.hs"
addFile "StudentB" "StudentB.hs"
query "Test"
print url
```This example establishes a connection with Moss using Haskell as the selected programming language. We assume that some skeleton code (`Skeleton.hs`) has been made available to students and relevant parts from that file should be ignored for plagiarism checking. The example then uploads two students' submissions (`StudentA.hs` and `StudentB.hs`) before telling Moss to run the plagiarism check with `query` which eventually returns a URL to the results.