{"id":20707008,"url":"https://github.com/code-help-tutor/par-hw-assignment-4-haskell","last_synced_at":"2025-07-08T16:33:48.428Z","repository":{"id":234136822,"uuid":"784579491","full_name":"code-help-tutor/par-hw-Assignment-4-Haskell","owner":"code-help-tutor","description":"par 代写代做 编程辅导, code help, CS tutor, WeChat: cstutorcs Email: tutorcs@163.com","archived":false,"fork":false,"pushed_at":"2024-04-10T06:07:25.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-17T20:28:45.436Z","etag":null,"topics":["par"],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/code-help-tutor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-04-10T06:07:20.000Z","updated_at":"2024-04-10T06:07:29.000Z","dependencies_parsed_at":"2024-04-18T09:30:41.117Z","dependency_job_id":null,"html_url":"https://github.com/code-help-tutor/par-hw-Assignment-4-Haskell","commit_stats":null,"previous_names":["code-help-tutor/par-hw-assignment-4-haskell"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-help-tutor%2Fpar-hw-Assignment-4-Haskell","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-help-tutor%2Fpar-hw-Assignment-4-Haskell/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-help-tutor%2Fpar-hw-Assignment-4-Haskell/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/code-help-tutor%2Fpar-hw-Assignment-4-Haskell/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/code-help-tutor","download_url":"https://codeload.github.com/code-help-tutor/par-hw-Assignment-4-Haskell/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242974396,"owners_count":20215324,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["par"],"created_at":"2024-11-17T01:24:33.288Z","updated_at":"2025-03-11T05:19:09.071Z","avatar_url":"https://github.com/code-help-tutor.png","language":"Haskell","readme":"# Assignment 4\n\n## Instructions\nYou should edit `src/Lib.hs`\n\n## Testing\nWe've added a basic test suite so you can check the performance of your\nparallelized mandelbrot set. This should make it easier to check your\nimplementation and make sure its run in parallel. I've also updated the\nparallelism so that it defaults to running on as many cores as you have,\nwhich might make the effects a bit more obvious. A couple notes:\n\nYou can run the default suite as follows\n```bash\nstack test\n```\n\nIf you want to only test your parallel version, you can run\n```bash\nstack test --test-arguments \"-m prefix runMandelPar\"\n```\nwhich can be useful once you know how long `runMandelSeq` takes,\nas the time won't change between runs.\n\nSimilarly, if wanted, you can do the same with `runMandelSeq` as the prefix\nto only profile `runMandelSeq`.\n\n### Testing Some of Part 2\nAs we've added `Handle` to the signatures, you can now run these for testing\noutput to the console by passing `stdout` (which is in `System.IO`) to these functions.\n\n## Viewing your results\nSo, something that might not have been *entirely* clear is that a `.ppm` file\nis a type of *image*. On macOS, there's default support for viewing these\nwith `Preview`. On Linux, I'd recommend `feh` on X11 or `imv` on Wayland,\nthough most things *should* support ppms. On Windows, however,\ntragically the default image viewer doesn't support `ppm`s, to that \nend I'd recommend [this online viewer](https://www.cs.rhodes.edu/welshc/COMP141_F16/ppmReader.html),\nwhich also has pretty nice errors for smaller mistakes. I've also heard Photoshop can open them,\nthough I haven't tested this myself.\n\n## Migration\nMost of the stuff in `Lib.hs` is the same, but there are a few changes I'll highlight. We've\nchanged `runMandelSeq` to take an `n` parameter and be pure instead of an `IO` action, closer\nto how `runMandelPar` works. The `n` parameter allows us to pass it to `writeMandel`, which is\na slightly changed version of `writeMandelPar` which allows for running either the sequential\nor the parallel version. These changes serve to make it easier to test. \n\nAs far as methods you're implementing go, we've changed the type signature on a few of them.\n```hs\nrunMandelPar :: Int -\u003e [[Int]]\n```\nThis is a pretty small change, and should allow you to avoid the use of\n`fromIntegral` a bit more than previously.\n\nWe've added a parameter to `jose'sDVDEmporium` indicating the number of drivers,\nas well as handles for in/out IO.\n```hs\njose'sDVDEmporium :: Int -\u003e Handle -\u003e -\u003e Handle -\u003e IO ()\n```\n\nFor a couple of the other part 2 functions, we've added `Handle` in (`deliver`, `takeOrders`). This is\nso we can pass in either `stdout or `stdin`, or something else for the sake of testing.\n\nWe've also swapped `TVar Bool` to `TMVar ()` on `deliver`, as `TVar Bool`\nwas insufficient for synchronization and would thus result in jumbled output. `TMVar ()`\nis pretty much like an `MVar ()` and you can treat it as such.\n\nSo to move your stuff, you just need to copy paste your methods for the most part.\nThe only differences being in your `runMandelPar` and some of the part 2 functions.\n`runMandelPar`, you should have to change *very* little anyways.\n# par hw Assignment 4 Haskell\n\n# 程序代做代写 CS编程辅导\n\n# WeChat: cstutorcs\n\n# Email: tutorcs@163.com\n\n# CS Tutor\n\n# Code Help\n\n# Programming Help\n\n# Computer Science Tutor\n\n# QQ: 749389476\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-help-tutor%2Fpar-hw-assignment-4-haskell","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcode-help-tutor%2Fpar-hw-assignment-4-haskell","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcode-help-tutor%2Fpar-hw-assignment-4-haskell/lists"}