Learn You a Physics for Great Good!

>>> WORK IN PROGRESS <<<

Introduction / About this book

About this book

You’ve arrived at Learn You a Physics for Great Good, the #1 stop for all your beginner-to-intermediate needs of learning Physics through the use of Domain Specific Languages (DSLs).

This book was written as a BSc thesis project at Chalmers University of Technology as an offshoot of a bachelor’s level elective course Domain Specific Languages of Mathematics. The goal of the the project and the reason for the existence of this book, is to help (primarily CS) students learn physics better. We think that the use of domain specific languages to teach the subject will help set these students in the right mindset to learn physics efficiently and properly. An observed problem has been that students base their mental models completely or partially on intuition and incorrect assumptions, instead of on definitions and proved theorems where validity is ensured. This may be a bad habit stemming from the way math and physics is taught in earlier stages of the education, and we think that DSLs will inherently force students into the right mindset for learning this subject well! Further, many textbooks on physics are incredibly thick and boring, so we’ve decided to emulate the great and good Learn You a Haskell for Great Good in order to provide som comic relief in between all the dramatic definitions.

In this book, we will study physics through the lens of DSLs. We will need to pay close attention to definitions, throughly ponder any non-trivial syntax, and verify (via tests or proofs) that the things we do are actually correct. The areas covered include such things as: dimensional analysis, vectors, calculus, and more!

The book is aimed at you who have some knowledge of Haskell. If you know what a class and an instance is, you’re probably good to go! Even if you don’t we’re sure you could pick it up as we go. We believe in you!

If you wonder about the weird code blocks at the start of many chapters,

module Introduction.About where

they are there to declare the chapters as Haskell modules. All chapters are written in Literate Haskell, and can be used with GHC/GHCi directly as source code. Therefore, you may choose to read each chapter as documented source code, rather than text with examples.